Spaces:
Sleeping
Sleeping
| # Quick sync script to push changes to Hugging Face Space | |
| # Usage: ./sync_to_hf.sh [commit message] | |
| set -e | |
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| cd "$SCRIPT_DIR" | |
| # Get commit message from argument or use default | |
| COMMIT_MSG="${1:-Update from local development}" | |
| echo "π Syncing changes to Hugging Face Space..." | |
| echo "" | |
| # Check for uncommitted changes | |
| if git diff --quiet && git diff --cached --quiet; then | |
| echo "β No changes to commit" | |
| else | |
| echo "π Staging changes..." | |
| git add -A | |
| echo "πΎ Committing changes..." | |
| git commit -m "$COMMIT_MSG" | |
| fi | |
| # Check if we're ahead of remote | |
| LOCAL=$(git rev-parse @) | |
| REMOTE=$(git rev-parse @{u} 2>/dev/null || echo "") | |
| if [ -z "$REMOTE" ] || [ "$LOCAL" != "$REMOTE" ]; then | |
| echo "π€ Pushing to remote..." | |
| git push origin main | |
| echo "" | |
| echo "β Changes pushed successfully!" | |
| echo " The Space will rebuild automatically (may take 2-5 minutes)" | |
| echo " Monitor: https://huggingface.co/spaces/roileveko/depth-anything-3" | |
| else | |
| echo "β Already up to date with remote" | |
| fi | |