Spaces:
Sleeping
Sleeping
| echo "π Checking for changes..." | |
| if [[ -n $(git status -s) ]]; then | |
| echo "β Changes detected, committing..." | |
| git add . | |
| # Prompt for commit message | |
| read -p "π Commit message (press Enter for default): " commit_msg | |
| if [ -z "$commit_msg" ]; then | |
| commit_msg="Update $(date '+%Y-%m-%d %H:%M')" | |
| fi | |
| git commit -m "$commit_msg" | |
| else | |
| echo "β No changes to commit" | |
| fi | |
| echo "" | |
| echo "π Pushing to GitHub..." | |
| git push origin main | |
| echo "" | |
| echo "π Pushing to Hugging Face Spaces..." | |
| git push huggingface main --force | |
| echo "" | |
| echo "β Successfully pushed to both GitHub and Hugging Face!" | |
| EOF | |
| chmod +x push-both.sh |