Spaces:
Runtime error
Runtime error
Download scripts/deploy_space.sh from jkos9/plotscribe: direct link, hf CLI and curl.
- Browser
- Download file 918 Bytes
-
https://huggingface.co/spaces/jkos9/plotscribe/resolve/main/scripts/deploy_space.sh
- Command line
-
hf download hf://spaces/jkos9/plotscribe/scripts/deploy_space.sh
-
curl -L -o deploy_space.sh https://huggingface.co/spaces/jkos9/plotscribe/resolve/main/scripts/deploy_space.sh
918 Bytes
| # Deploy the current commit to the Hugging Face Space (git remote "space"). | |
| # | |
| # Hugging Face rejects binary files committed directly to git, so this pushes a | |
| # deploy commit with the same code minus docs/ (images), on top of the Space's | |
| # current history. GitHub history is left untouched. | |
| set -euo pipefail | |
| cd "$(git rev-parse --show-toplevel)" | |
| if [ -n "$(git status --porcelain)" ]; then | |
| echo "Commit your changes first." >&2 | |
| exit 1 | |
| fi | |
| git fetch -q space | |
| idx="$(mktemp)" | |
| GIT_INDEX_FILE="$idx" git read-tree HEAD | |
| GIT_INDEX_FILE="$idx" git rm -q --cached -r --ignore-unmatch docs | |
| tree="$(GIT_INDEX_FILE="$idx" git write-tree)" | |
| rm -f "$idx" | |
| msg="Deploy $(git rev-parse --short HEAD): $(git log -1 --format=%s)" | |
| commit="$(git commit-tree "$tree" -p space/main -m "$msg")" | |
| git push space "${commit}:refs/heads/main" | |
| echo "Deployed $(git rev-parse --short HEAD) to the Space as ${commit:0:7}." | |