novel-doomsday-resurgence/novel-tracker/scripts/check-duplicates.sh
唐天洛 bc9188b0fd feat(git-workflow): 添加 Git 工作流和脚本
包含:
- GIT_WORKFLOW.md - 详细的 Git 工作流规范
- scripts/git-setup.sh - Git 工作区初始化脚本
- scripts/git-daily.sh - 日常 Git 管理脚本
- scripts/git-novel-workflow.sh - 小说专用 Git 工作流
- 更新 .gitignore 排除子仓库的 .git 目录
- 添加 novel-tracker/ 目录
- 添加 projects/ 目录(排除子仓库 .git)
- 添加 tomato-novel/ 目录
2026-03-30 15:50:36 +08:00

51 lines
1.4 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
# check-duplicates.sh - 检查重复文档脚本
# 使用方法:./check-duplicates.sh
# 功能:检查飞书或本地是否有重复的文档
set -e
# 颜色输出
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\133[1;33m'
NC='\033[0m' # No Color
echo -e "${YELLOW}=== 检查重复文档 ===${NC}"
echo ""
# 检查本地重复文档
echo -e "${YELLOW}检查本地重复文档...${NC}"
echo ""
# 检查 current/ 目录
if [ -d "current/" ]; then
# 检查大纲重复
if [ -f "current/outline.md" ] && [ -f "current/32-chapters-outline-final.md" ]; then
echo -e "${RED}发现重复大纲:${NC}"
echo " - current/outline.md"
echo " - current/32-chapters-outline-final.md"
echo " - 建议:保留 current/outline.md删除或归档另一个"
echo ""
fi
# 检查章节重复
for chapter in current/chapter-*.md; do
chapter_name=$(basename "$chapter" .md)
# 检查是否有多个版本在 archive/
count=$(find archive/chapter-history -name "$chapter_name*.md" 2>/dev/null | wc -l)
if [ $count -gt 1 ]; then
echo -e "${YELLOW}章节 $chapter_name$count 个历史版本${NC}"
fi
done
fi
echo ""
echo -e "${YELLOW}检查完成!${NC}"
echo ""
echo -e "${GREEN}建议:${NC}"
echo "1. 删除重复的文档"
echo "2. 确保每个文档类型只有一个最新版本"
echo "3. 旧版本都归档到 archive/ 目录"