|
|
#!/bin/bash |
|
|
|
|
|
|
|
|
set -e |
|
|
|
|
|
echo "๐ Neural Pong - Complete Push and Cleanup" |
|
|
echo "===========================================" |
|
|
echo "" |
|
|
|
|
|
|
|
|
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 |
|
|
|
|
|
|
|
|
git add . |
|
|
if ! git diff --cached --quiet; then |
|
|
git commit -m "Add Neural Pong application files" || git commit --amend --no-edit |
|
|
fi |
|
|
|
|
|
|
|
|
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 "" |
|
|
|
|
|
|
|
|
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." |
|
|
|
|
|
|
|
|
|