pong / push.sh
chrisxx's picture
Add Neural Pong application files
8746765
raw
history blame
1.43 kB
#!/bin/bash
# Push script for /share/u/wendler/code/pong
# This will push all files to Hugging Face Spaces
set -e
cd /share/u/wendler/code/pong
echo "๐Ÿš€ Pushing Neural Pong to Hugging Face Spaces..."
echo ""
# Check if we're in a git repo
if [ ! -d ".git" ]; then
echo "โŒ Error: Not a git repository"
exit 1
fi
# Stage all files
echo "๐Ÿ“ Staging files..."
git add .
# Check status
echo ""
echo "๐Ÿ“‹ Files to be committed:"
git status --short | head -20
# Commit changes
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
# Check remote
echo ""
echo "๐Ÿ”— Checking remote..."
git remote -v
# Check branch
BRANCH=$(git branch --show-current 2>/dev/null || echo "main")
echo "๐ŸŒฟ Current branch: $BRANCH"
# Push
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."