|
|
#!/bin/bash |
|
|
|
|
|
|
|
|
|
|
|
set -e |
|
|
|
|
|
cd /share/u/wendler/code/pong |
|
|
|
|
|
echo "๐ Pushing Neural Pong to Hugging Face Spaces..." |
|
|
echo "" |
|
|
|
|
|
|
|
|
if [ ! -d ".git" ]; then |
|
|
echo "โ Error: Not a git repository" |
|
|
exit 1 |
|
|
fi |
|
|
|
|
|
|
|
|
echo "๐ Staging files..." |
|
|
git add . |
|
|
|
|
|
|
|
|
echo "" |
|
|
echo "๐ Files to be committed:" |
|
|
git status --short | head -20 |
|
|
|
|
|
|
|
|
echo "" |
|
|
if git diff --cached --quiet; then |
|
|
echo "โ
No changes to commit" |
|
|
else |
|
|
echo "๐พ Committing changes..." |
|
|
git commit -m "Add Neural Pong application files" || git commit --amend --no-edit |
|
|
echo "โ
Changes committed" |
|
|
fi |
|
|
|
|
|
|
|
|
echo "" |
|
|
echo "๐ Checking remote..." |
|
|
git remote -v |
|
|
|
|
|
|
|
|
BRANCH=$(git branch --show-current 2>/dev/null || echo "main") |
|
|
echo "๐ฟ Current branch: $BRANCH" |
|
|
|
|
|
|
|
|
echo "" |
|
|
echo "๐ค Pushing to Hugging Face Spaces..." |
|
|
if git push -u origin $BRANCH 2>&1; then |
|
|
echo "" |
|
|
echo "โ
Successfully pushed!" |
|
|
else |
|
|
echo "" |
|
|
echo "โ ๏ธ Push failed, trying force push..." |
|
|
git push -u origin $BRANCH --force |
|
|
echo "" |
|
|
echo "โ
Force pushed successfully!" |
|
|
fi |
|
|
|
|
|
echo "" |
|
|
echo "๐ Your Space is available at:" |
|
|
echo " https://huggingface.co/spaces/wendlerc/pong" |
|
|
echo "" |
|
|
echo "The build should start automatically. Check the Logs tab for progress." |
|
|
|