| # Simple helper script to push this repo to Hugging Face. | |
| # Assumes: | |
| # - You are in the repo root (same directory as this script), or | |
| # - `origin` remote is already set to https://huggingface.co/shahidul034/readCtrl_lambda | |
| # - You have configured your Hugging Face token for git authentication. | |
| # cd /home/mshahidul/readctrl && bash push_to_hf.sh "new commit" | |
| set -euo pipefail | |
| REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| cd "$REPO_DIR" | |
| # Use first argument as commit message, or a default one. | |
| COMMIT_MSG="${1:-\"Update readCtrl repo\"}" | |
| echo "Adding changes (respecting .gitignore)..." | |
| git add . | |
| if git diff --cached --quiet; then | |
| echo "No changes to commit. Nothing to push." | |
| exit 0 | |
| fi | |
| echo "Committing with message: $COMMIT_MSG" | |
| git commit -m "$COMMIT_MSG" | |
| echo "Pushing to origin main..." | |
| git push origin main | |
| echo "Done." | |