pong / push-and-cleanup.sh
chrisxx's picture
Add Neural Pong application files
8746765
raw
history blame
1.97 kB
#!/bin/bash
# Complete script: Push from pong directory and clean up
set -e
echo "๐Ÿš€ Neural Pong - Complete Push and Cleanup"
echo "==========================================="
echo ""
# Step 1: Push from pong directory
echo "Step 1: Pushing from /share/u/wendler/code/pong"
echo "-----------------------------------------------"
cd /share/u/wendler/code/pong
if [ ! -d ".git" ]; then
echo "โŒ Error: Not a git repository in pong directory"
exit 1
fi
# Stage and commit
git add .
if ! git diff --cached --quiet; then
git commit -m "Add Neural Pong application files" || git commit --amend --no-edit
fi
# Push
BRANCH=$(git branch --show-current 2>/dev/null || echo "main")
echo "Pushing to origin/$BRANCH..."
if ! git push -u origin $BRANCH 2>&1; then
echo "Trying force push..."
git push -u origin $BRANCH --force
fi
echo ""
echo "โœ… Successfully pushed to Hugging Face Spaces!"
echo ""
# Step 2: Cleanup temporary files
echo "Step 2: Cleaning up temporary files"
echo "-----------------------------------"
CLEANUP_DIR="/share/u/wendler/code/toy-wm-hf-space"
if [ -d "$CLEANUP_DIR" ]; then
cd "$CLEANUP_DIR"
echo "Removing temporary scripts..."
rm -f push.sh push-now.sh push-force.sh setup-git.sh setup.sh \
fix-remote.sh fix-and-push.sh push-to-hf.py 2>/dev/null || true
echo "Removing temporary documentation..."
rm -f RUN_SETUP.md TROUBLESHOOTING.md SETUP_STEPS.md \
SETUP_GUIDE.md QUICKSTART.md START_HERE.md 2>/dev/null || true
echo "โœ… Cleanup complete!"
else
echo "โš ๏ธ Cleanup directory not found, skipping"
fi
echo ""
echo "==========================================="
echo "โœ… All done!"
echo "==========================================="
echo ""
echo "๐ŸŒ Your Space: https://huggingface.co/spaces/wendlerc/pong"
echo "๐Ÿ“ Working directory: /share/u/wendler/code/pong"
echo ""
echo "The build should start automatically. Check the Logs tab for progress."