File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 2020 " miniprogram" ,
2121 " web-development"
2222 ],
23+ "commands" : [
24+ " ./config/.claude/commands/spec.md" ,
25+ " ./config/.claude/commands/no_spec.md" ,
26+ " ./config/.claude/commands/prototype.md"
27+ ],
2328 "mcpServers" : " ./.mcp.json"
2429}
Original file line number Diff line number Diff line change @@ -40,6 +40,12 @@ MCP_TARGETS=(
4040 " .mcp.json"
4141)
4242
43+ # Commands 目录硬链接
44+ COMMANDS_SOURCE=" config/.claude/commands"
45+ COMMANDS_TARGETS=(
46+ " commands"
47+ )
48+
4349echo -e " ${BLUE} 🔧 CloudBase AI 配置文件硬链接修复工具${NC} "
4450echo " =================================================="
4551
@@ -150,3 +156,40 @@ echo -e "\n${BLUE}📋 所有硬链接文件:${NC}"
150156find . -samefile " $MCP_SOURCE " | sort
151157
152158echo -e " \n${GREEN} ✨ MCP 硬链接修复完成!现在修改任何一个文件都会同步到所有其他文件。${NC} "
159+
160+ # 处理 Commands 目录硬链接
161+ echo -e " \n${BLUE} 📁 处理 Commands 目录: $COMMANDS_SOURCE ${NC} "
162+
163+ # 检查源目录是否存在
164+ if [ ! -d " $COMMANDS_SOURCE " ]; then
165+ echo -e " ${RED} ❌ 错误: 源目录 $COMMANDS_SOURCE 不存在${NC} "
166+ exit 1
167+ fi
168+
169+ echo -e " ${GREEN} ✅ 源目录存在: $COMMANDS_SOURCE ${NC} "
170+
171+ # 检查目标目录状态
172+ for target in " ${COMMANDS_TARGETS[@]} " ; do
173+ if [ -d " $target " ]; then
174+ echo -e " ${YELLOW} ⚠️ $target (目录已存在)${NC} "
175+ echo -e " ${YELLOW} ❓ 是否删除现有目录并创建硬链接? [y/N]${NC} "
176+ read -r response
177+ if [[ " $response " =~ ^[Yy]$ ]]; then
178+ echo -e " ${YELLOW} 🗑️ 删除现有目录: $target ${NC} "
179+ rm -rf " $target "
180+ else
181+ echo -e " ${BLUE} 🚫 跳过目录 $target ${NC} "
182+ continue
183+ fi
184+ fi
185+
186+ # 创建硬链接
187+ echo -e " ${YELLOW} 🔄 创建硬链接: $target ${NC} "
188+ if ln " $COMMANDS_SOURCE " " $target " 2> /dev/null; then
189+ echo -e " ${GREEN} ✅ Commands 目录硬链接创建成功${NC} "
190+ else
191+ echo -e " ${RED} ❌ Commands 目录硬链接创建失败${NC} "
192+ fi
193+ done
194+
195+ echo -e " \n${GREEN} ✨ Commands 硬链接修复完成!${NC} "
You can’t perform that action at this time.
0 commit comments