Spaces:
Running
Running
Download huggingface/sync-space.sh from 4math/tiled-map-builder: direct link, hf CLI and curl.
- Browser
- Download file 989 Bytes
-
https://huggingface.co/spaces/4math/tiled-map-builder/resolve/main/huggingface/sync-space.sh
- Command line
-
hf download hf://spaces/4math/tiled-map-builder/huggingface/sync-space.sh
-
curl -L -o sync-space.sh https://huggingface.co/spaces/4math/tiled-map-builder/resolve/main/huggingface/sync-space.sh
989 Bytes
| # Publish the current commit of this repository to its Hugging Face Space. | |
| # | |
| # huggingface/sync-space.sh [OWNER/SPACE] default: 4math/tiled-map-builder | |
| # | |
| # Needs git and the hf CLI (pip install -U huggingface_hub), logged in with write access to the | |
| # Space: run "hf auth login" or set HF_TOKEN. The Space then rebuilds from the Dockerfile. | |
| # | |
| # The Space's README.md must start with its YAML card, so the uploaded README is | |
| # huggingface/space-card.md followed by the repository README. Files deleted from the | |
| # repository are deleted from the Space too. | |
| set -eu | |
| SPACE="${1:-4math/tiled-map-builder}" | |
| ROOT="$(cd "$(dirname "$0")/.." && pwd)" | |
| STAGE="$(mktemp -d)" | |
| trap 'rm -rf "$STAGE"' EXIT | |
| git -C "$ROOT" archive HEAD | tar -x -C "$STAGE" | |
| cat "$ROOT/huggingface/space-card.md" "$ROOT/README.md" > "$STAGE/README.md" | |
| hf upload "$SPACE" "$STAGE" . \ | |
| --repo-type space \ | |
| --delete "*" \ | |
| --commit-message "Sync from GitHub $(git -C "$ROOT" rev-parse --short HEAD)" | |