Spaces:
Sleeping
Sleeping
| @echo off | |
| setlocal enabledelayedexpansion | |
| echo π Checking for changes... | |
| :: Check if there are changes | |
| git status --short > temp_status.txt | |
| set /p first_line=<temp_status.txt | |
| del temp_status.txt | |
| if defined first_line ( | |
| echo β Changes detected, committing... | |
| git add . | |
| :: Prompt for commit message | |
| set /p commit_msg="π Commit message (press Enter for default): " | |
| if "!commit_msg!"=="" ( | |
| :: Generate default commit message with date and time | |
| for /f "tokens=1-3 delims=/ " %%a in ('date /t') do set mydate=%%c-%%a-%%b | |
| for /f "tokens=1-2 delims=: " %%a in ('time /t') do set mytime=%%a:%%b | |
| set commit_msg=Update !mydate! !mytime! | |
| ) | |
| git commit -m "!commit_msg!" | |
| ) else ( | |
| echo β No changes to commit | |
| ) | |
| 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! | |
| echo. | |
| pause |