Spaces:
Sleeping
Sleeping
Download scripts/generate.sh from JonCard/infiniteradio: direct link, hf CLI and curl.
- Browser
- Download file 753 Bytes
-
https://huggingface.co/spaces/JonCard/infiniteradio/resolve/main/scripts/generate.sh
- Command line
-
hf download hf://spaces/JonCard/infiniteradio/scripts/generate.sh
-
curl -L -o generate.sh https://huggingface.co/spaces/JonCard/infiniteradio/resolve/main/scripts/generate.sh
753 Bytes
| # Regenerates the FastAPI routes and models in generated/ from infiniteradio.yml. | |
| # Run after every change to the API definition; never edit generated/ by hand. | |
| # Optional argument: output directory (default: generated). | |
| set -euo pipefail | |
| cd "$(dirname "$0")/.." | |
| out="${1:-generated}" | |
| # Import sorting depends on the output location, so always generate in a temp | |
| # directory to get the same result wherever the output goes. | |
| tmp="$(mktemp -d)" | |
| trap 'rm -rf "$tmp"' EXIT | |
| fastapi-codegen \ | |
| --input infiniteradio.yml \ | |
| --output "$tmp/generated" \ | |
| --template-dir codegen/templates \ | |
| --output-model-type pydantic_v2.BaseModel \ | |
| --disable-timestamp | |
| touch "$tmp/generated/__init__.py" | |
| rm -rf "$out" | |
| cp -R "$tmp/generated" "$out" | |