📝 docs: .gitignore 자동 추가 및 설치 스크립트 수정
This commit is contained in:
@@ -56,13 +56,18 @@ git submodule update --init --recursive
|
|||||||
bash .claude/common/scripts/install.sh https://git.sginfra.net/sgp-web-d/gameservice-fe-agent.git
|
bash .claude/common/scripts/install.sh https://git.sginfra.net/sgp-web-d/gameservice-fe-agent.git
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> `install.sh`는 `.gitignore`에 `.claude/common/`를 자동으로 추가합니다.
|
||||||
|
> `.gitignore`가 없으면 새로 생성합니다.
|
||||||
|
|
||||||
설치 후 프로젝트 구조는 다음과 같이 됩니다.
|
설치 후 프로젝트 구조는 다음과 같이 됩니다.
|
||||||
|
|
||||||
```
|
```
|
||||||
your-project/
|
your-project/
|
||||||
├── .claude/
|
├── .claude/
|
||||||
│ ├── common/ ← submodule (gameservice-fe-agent)
|
│ ├── common/ ← submodule (gameservice-fe-agent)
|
||||||
│ └── project/ ← 프로젝트 고유 지침
|
│ ├── project/ ← 프로젝트 고유 지침
|
||||||
|
│ └── skills/ ← 공통 skill 심볼릭 링크
|
||||||
|
├── .gitignore ← .claude/common/ 자동 추가됨
|
||||||
├── CLAUDE.md ← 공통 + 프로젝트 지침을 @import
|
├── CLAUDE.md ← 공통 + 프로젝트 지침을 @import
|
||||||
└── ...
|
└── ...
|
||||||
```
|
```
|
||||||
@@ -109,6 +114,7 @@ bash .claude/common/scripts/update.sh
|
|||||||
```bash
|
```bash
|
||||||
bash .claude/common/scripts/install.sh https://git.sginfra.net/sgp-web-d/gameservice-fe-agent.git
|
bash .claude/common/scripts/install.sh https://git.sginfra.net/sgp-web-d/gameservice-fe-agent.git
|
||||||
# → .claude/common 에 submodule 설치
|
# → .claude/common 에 submodule 설치
|
||||||
|
# → .gitignore 에 .claude/common/ 추가
|
||||||
# → templates/project/*.md 를 .claude/project/ 로 복사
|
# → templates/project/*.md 를 .claude/project/ 로 복사
|
||||||
# → templates/CLAUDE.md.tpl 을 루트 CLAUDE.md 로 복사
|
# → templates/CLAUDE.md.tpl 을 루트 CLAUDE.md 로 복사
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -43,7 +43,22 @@ else
|
|||||||
echo "✅ submodule 추가 완료: $TARGET_PATH"
|
echo "✅ submodule 추가 완료: $TARGET_PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 2) 프로젝트 지침 양식 복사 (templates/project/ → .claude/project/)
|
# 2) .gitignore 에 .claude/common 추가
|
||||||
|
GITIGNORE=".gitignore"
|
||||||
|
IGNORE_ENTRY=".claude/common/"
|
||||||
|
if [[ -f "$GITIGNORE" ]]; then
|
||||||
|
if grep -qF "$IGNORE_ENTRY" "$GITIGNORE" || grep -qF ".claude/common" "$GITIGNORE"; then
|
||||||
|
echo "ℹ️ .gitignore 에 '$IGNORE_ENTRY' 가 이미 있습니다. 건너뜁니다."
|
||||||
|
else
|
||||||
|
printf "\n# gameservice-fe-agent submodule\n%s\n" "$IGNORE_ENTRY" >> "$GITIGNORE"
|
||||||
|
echo "✅ .gitignore 에 '$IGNORE_ENTRY' 를 추가했습니다."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
printf "# gameservice-fe-agent submodule\n%s\n" "$IGNORE_ENTRY" > "$GITIGNORE"
|
||||||
|
echo "✅ .gitignore 를 생성하고 '$IGNORE_ENTRY' 를 추가했습니다."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 4) 프로젝트 지침 양식 복사 (templates/project/ → .claude/project/)
|
||||||
mkdir -p "$PROJECT_PATH"
|
mkdir -p "$PROJECT_PATH"
|
||||||
|
|
||||||
TEMPLATE_DIR="$TARGET_PATH/templates/project"
|
TEMPLATE_DIR="$TARGET_PATH/templates/project"
|
||||||
@@ -64,7 +79,7 @@ else
|
|||||||
echo "⚠️ $TEMPLATE_DIR 를 찾지 못했습니다. 공통 저장소의 templates 가 오래됐을 수 있습니다."
|
echo "⚠️ $TEMPLATE_DIR 를 찾지 못했습니다. 공통 저장소의 templates 가 오래됐을 수 있습니다."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 3) 루트 CLAUDE.md 템플릿 복사
|
# 5) 루트 CLAUDE.md 템플릿 복사
|
||||||
if [[ ! -f "CLAUDE.md" ]]; then
|
if [[ ! -f "CLAUDE.md" ]]; then
|
||||||
TPL_FILE="$TARGET_PATH/templates/CLAUDE.md.tpl"
|
TPL_FILE="$TARGET_PATH/templates/CLAUDE.md.tpl"
|
||||||
if [[ -f "$TPL_FILE" ]]; then
|
if [[ -f "$TPL_FILE" ]]; then
|
||||||
@@ -97,7 +112,7 @@ else
|
|||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 4) 공통 skill 심볼릭 링크 (.claude/common/skills/* → .claude/skills/*)
|
# 6) 공통 skill 심볼릭 링크 (.claude/common/skills/* → .claude/skills/*)
|
||||||
SKILLS_SRC="$TARGET_PATH/skills"
|
SKILLS_SRC="$TARGET_PATH/skills"
|
||||||
SKILLS_DEST=".claude/skills"
|
SKILLS_DEST=".claude/skills"
|
||||||
|
|
||||||
@@ -131,5 +146,5 @@ echo ""
|
|||||||
echo "다음 작업을 진행해 주세요:"
|
echo "다음 작업을 진행해 주세요:"
|
||||||
echo " 1) $PROJECT_PATH/*.md 내용을 프로젝트에 맞게 채우기"
|
echo " 1) $PROJECT_PATH/*.md 내용을 프로젝트에 맞게 채우기"
|
||||||
echo " 2) 변경 사항을 커밋하기"
|
echo " 2) 변경 사항을 커밋하기"
|
||||||
echo " git add .gitmodules .claude CLAUDE.md"
|
echo " git add .gitmodules .gitignore .claude CLAUDE.md"
|
||||||
echo " git commit -m 'chore: add gameservice-fe-agent submodule'"
|
echo " git commit -m 'chore: add gameservice-fe-agent submodule'"
|
||||||
|
|||||||
Reference in New Issue
Block a user