NAC_Blockchain/scripts/clean_all.sh

64 lines
1.5 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# NAC区块链统一清理脚本
# 作者NAC公链开发小组
# 颜色定义
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
echo "========================================="
echo " NAC区块链统一清理脚本"
echo "========================================="
echo ""
CLEANED=0
# 清理模块函数
clean_module() {
local module=$1
local name=$2
if [ -d "$module" ]; then
echo -e "${YELLOW}正在清理 ${name}...${NC}"
cd "$module"
if [ -d "target" ]; then
rm -rf target
echo -e "${GREEN}${name} 清理完成${NC}"
((CLEANED++))
else
echo -e "${YELLOW} ${name} 无需清理${NC}"
fi
cd ..
fi
}
# 清理所有模块
clean_module "nac-udm" "NAC统一数据模型"
clean_module "charter-compiler" "Charter编译器"
clean_module "nvm_v2" "NAC虚拟机v2"
clean_module "nac-nvm" "NAC虚拟机"
clean_module "nac-cbpp" "CBPP共识协议"
clean_module "nac-gnacs" "GNACS资产分类"
clean_module "nac-acc" "ACC协议"
clean_module "nac-acc20c" "ACC-20C合规协议"
clean_module "nac-rpc" "NAC RPC接口"
clean_module "nac-storage" "NAC存储层"
# 清理临时文件
echo ""
echo "正在清理临时文件..."
rm -f /tmp/build_*.log
rm -f /tmp/test_*.log
echo -e "${GREEN}✓ 临时文件清理完成${NC}"
echo ""
echo "========================================="
echo "清理完成"
echo "========================================="
echo "已清理 ${CLEANED} 个模块"
echo ""