|
| 1 | +# GitHub Push Script for AI_Coder_AllInOne (Windows PowerShell) |
| 2 | + |
| 3 | +Write-Host "🚀 AI Coder All-in-One - GitHub Push Script" -ForegroundColor Cyan |
| 4 | +Write-Host "============================================" -ForegroundColor Cyan |
| 5 | +Write-Host "" |
| 6 | + |
| 7 | +# Check if git is initialized |
| 8 | +if (-not (Test-Path ".git")) { |
| 9 | + Write-Host "❌ Error: Not a git repository. Run 'git init' first." -ForegroundColor Red |
| 10 | + exit 1 |
| 11 | +} |
| 12 | + |
| 13 | +# Prompt for GitHub username |
| 14 | +$GITHUB_USERNAME = Read-Host "Enter your GitHub username" |
| 15 | + |
| 16 | +if ([string]::IsNullOrWhiteSpace($GITHUB_USERNAME)) { |
| 17 | + Write-Host "❌ Error: GitHub username cannot be empty." -ForegroundColor Red |
| 18 | + exit 1 |
| 19 | +} |
| 20 | + |
| 21 | +Write-Host "" |
| 22 | +Write-Host "📝 Setting up remote repository..." -ForegroundColor Yellow |
| 23 | + |
| 24 | +# Remove existing origin if it exists |
| 25 | +git remote remove origin 2>$null |
| 26 | + |
| 27 | +# Add new origin |
| 28 | +git remote add origin "https://github.com/$GITHUB_USERNAME/AI_Coder_AllInOne.git" |
| 29 | + |
| 30 | +Write-Host "✅ Remote added: https://github.com/$GITHUB_USERNAME/AI_Coder_AllInOne.git" -ForegroundColor Green |
| 31 | +Write-Host "" |
| 32 | + |
| 33 | +# Rename branch to main |
| 34 | +Write-Host "📝 Renaming branch to 'main'..." -ForegroundColor Yellow |
| 35 | +git branch -M main |
| 36 | + |
| 37 | +Write-Host "" |
| 38 | +Write-Host "🔄 Pushing to GitHub..." -ForegroundColor Yellow |
| 39 | +Write-Host "" |
| 40 | + |
| 41 | +# Push to GitHub |
| 42 | +git push -u origin main |
| 43 | + |
| 44 | +if ($LASTEXITCODE -eq 0) { |
| 45 | + Write-Host "" |
| 46 | + Write-Host "✅ Successfully pushed to GitHub!" -ForegroundColor Green |
| 47 | + Write-Host "" |
| 48 | + Write-Host "📦 Next steps:" -ForegroundColor Cyan |
| 49 | + Write-Host "1. Visit: https://github.com/$GITHUB_USERNAME/AI_Coder_AllInOne" |
| 50 | + Write-Host "2. Enable GitHub Actions (should be automatic)" |
| 51 | + Write-Host "3. Wait for Docker image to build" |
| 52 | + Write-Host "4. Update README.md badges with your username" |
| 53 | + Write-Host "" |
| 54 | + Write-Host "🐳 Once built, your image will be available at:" -ForegroundColor Cyan |
| 55 | + Write-Host " ghcr.io/$GITHUB_USERNAME/ai_coder_allinone:latest" |
| 56 | +} else { |
| 57 | + Write-Host "" |
| 58 | + Write-Host "❌ Push failed. Please check:" -ForegroundColor Red |
| 59 | + Write-Host "1. Repository exists: https://github.com/$GITHUB_USERNAME/AI_Coder_AllInOne" |
| 60 | + Write-Host "2. You have push permissions" |
| 61 | + Write-Host "3. Your GitHub credentials are correct" |
| 62 | +} |
0 commit comments