Download scripts/deploy-space.sh from ya02/kalim: direct link, hf CLI and curl.
- Browser
- Download file 922 Bytes
-
https://huggingface.co/spaces/ya02/kalim/resolve/main/scripts/deploy-space.sh
- Command line
-
hf download hf://spaces/ya02/kalim/scripts/deploy-space.sh
-
curl -L -o deploy-space.sh https://huggingface.co/spaces/ya02/kalim/resolve/main/scripts/deploy-space.sh
922 Bytes
| # Deploy the current HEAD to the Hugging Face Space as ONE history-free commit, | |
| # with binary files excluded — HF rejects plain-git binaries (docx/pdf), and the | |
| # Space only needs code + data/processed/*.json. GitHub main is never touched. | |
| # | |
| # Usage: ./scripts/deploy-space.sh (expects a git remote named "space") | |
| set -euo pipefail | |
| cd "$(git rev-parse --show-toplevel)" | |
| EXCLUDE=( | |
| "Kalim Thesis for Claude.docx" | |
| "docs/Holland_Scoring_Algorithm.pdf" | |
| "docs/TECHNICAL_DOCUMENTATION_AR.pdf" | |
| ) | |
| export GIT_INDEX_FILE=.git/space-deploy-index | |
| trap 'rm -f .git/space-deploy-index' EXIT | |
| git read-tree HEAD | |
| git rm --cached --quiet -- "${EXCLUDE[@]}" | |
| TREE=$(git write-tree) | |
| COMMIT=$(git commit-tree "$TREE" -m "Kalim Space deploy ($(git rev-parse --short HEAD))") | |
| unset GIT_INDEX_FILE | |
| git push space +"$COMMIT":refs/heads/main | |
| echo "Deployed $COMMIT (from $(git rev-parse --short HEAD)) to the Space." | |