Files
turbovault-app/scripts/setup-github.sh
2026-03-28 19:24:29 -04:00

126 lines
2.8 KiB
Bash
Executable File

#!/bin/bash
# TurboVault GitHub Setup Script
# This script helps you push your code to GitHub
set -e
echo "🚀 TurboVault GitHub Setup"
echo "=========================="
echo ""
# Check if we're in a git repo
if [ ! -d .git ]; then
echo "❌ Error: Not a git repository"
echo " Run: git init"
exit 1
fi
# Get GitHub username
read -p "Enter your GitHub username: " GITHUB_USER
# Get repository name (default: turbovault)
read -p "Enter repository name [turbovault]: " REPO_NAME
REPO_NAME=${REPO_NAME:-turbovault}
echo ""
echo "📝 Configuration:"
echo " GitHub User: $GITHUB_USER"
echo " Repository: $REPO_NAME"
echo " URL: https://github.com/$GITHUB_USER/$REPO_NAME"
echo ""
read -p "Is this correct? (y/n) " -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Aborted."
exit 1
fi
echo ""
echo "🔧 Setting up Git remotes..."
# Check if origin already exists
if git remote | grep -q "^origin$"; then
echo " ⚠️ Remote 'origin' already exists"
read -p " Remove and re-add? (y/n) " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
git remote remove origin
else
echo "Aborted."
exit 1
fi
fi
# Add GitHub as origin
git remote add origin "https://github.com/$GITHUB_USER/$REPO_NAME.git"
echo " ✅ Added GitHub remote 'origin'"
# Optional: Add Gitea as a second remote
read -p "Do you want to add Gitea as a second remote? (y/n) " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
read -p "Enter Gitea remote URL (e.g., https://gitea.example.com/user/repo.git): " GITEA_URL
if [ ! -z "$GITEA_URL" ]; then
git remote add gitea "$GITEA_URL"
echo " ✅ Added Gitea remote 'gitea'"
fi
fi
echo ""
echo "📦 Committing files..."
# Add all files
git add .
# Commit
git commit -m "Initial commit - TurboVault v1.0
Features:
- Full CRUD for video game collection
- IGDB integration for metadata
- Collections and genres
- Physical/Digital tracking
- CSV import/export
- RESTful API
- 5 beautiful themes
- Public profiles"
echo " ✅ Created initial commit"
echo ""
echo "🚀 Pushing to GitHub..."
# Set main as default branch
git branch -M main
# Push to GitHub
git push -u origin main
echo ""
echo "✅ Success! Your code is now on GitHub!"
echo ""
echo "🔗 View your repository:"
echo " https://github.com/$GITHUB_USER/$REPO_NAME"
echo ""
echo "📚 Next steps:"
echo " 1. Visit your repository and add a description"
echo " 2. Add topics/tags (rails, ruby, gaming, collection-tracker)"
echo " 3. Enable GitHub Pages (optional)"
echo " 4. Set up GitHub Actions for CI/CD (optional)"
echo ""
# Optional: Push to Gitea too
if git remote | grep -q "^gitea$"; then
read -p "Push to Gitea as well? (y/n) " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
git push -u gitea main
echo " ✅ Pushed to Gitea"
fi
fi
echo "🎉 All done!"