Initialize fe-common-rules repository with common Claude guidelines and scripts for frontend projects
This commit is contained in:
36
scripts/update.sh
Executable file
36
scripts/update.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# fe-common-rules updater
|
||||
# 현재 프로젝트에 설치된 .claude/common submodule 을 최신 버전으로 갱신합니다.
|
||||
#
|
||||
# 사용법:
|
||||
# bash .claude/common/scripts/update.sh
|
||||
#
|
||||
set -euo pipefail
|
||||
|
||||
TARGET_PATH=".claude/common"
|
||||
|
||||
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||
echo "❌ 현재 디렉토리는 Git 저장소가 아닙니다." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -d "$TARGET_PATH" ]]; then
|
||||
echo "❌ '$TARGET_PATH' 가 존재하지 않습니다. 먼저 install.sh 로 설치하세요." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "🔄 fe-common-rules 를 최신 버전으로 업데이트합니다..."
|
||||
git submodule update --remote --merge "$TARGET_PATH"
|
||||
|
||||
# 변경 사항 확인
|
||||
if git diff --quiet -- "$TARGET_PATH"; then
|
||||
echo "✅ 이미 최신 상태입니다."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "✅ 업데이트가 완료되었습니다. 변경된 submodule 포인터를 커밋하세요:"
|
||||
echo ""
|
||||
echo " git add $TARGET_PATH"
|
||||
echo " git commit -m 'chore: update fe-common-rules submodule'"
|
||||
Reference in New Issue
Block a user