fix: setup.sh and install.sh improvements (#155)

- setup.sh: Skip git init if .git already exists (prevents errors in existing repos)
- install.sh: Copy setup.sh directly instead of hardcoding a simplified version
  This ensures global installation uses the same setup logic as local,
  including .ralphrc generation via enable_core.sh

Co-authored-by: dawenrenhub <darwinren321@gmail.com>
This commit is contained in:
Dawen Ren 2026-02-03 00:00:11 +08:00 committed by GitHub
parent 627ad7d9a5
commit 48ba86a2de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 45 deletions

View file

@ -92,8 +92,10 @@ CB_OUTPUT_DECLINE_THRESHOLD=70
RALPHRCEOF
fi
# Initialize git
git init
# Initialize git (skip if already initialized)
if [[ ! -d ".git" ]]; then
git init
fi
echo "# $PROJECT_NAME" > README.md
git add .
git commit -m "Initial Ralph project setup"