#!/usr/bin/env bash # Download and vendor frontend JS libraries into webui/static/ # and backend binaries into vendor/. # Run from the project root after updating the VERSION variables below. set -euo pipefail # ---- Library versions ---- HTMX_VERSION="2.0.4" HTMX_JSON_ENC_VERSION="2.0.0" ACME_VERSION="3.1.3" STATIC_DIR="webui/static" download() { local name="$1" url="$2" dest="$3" if [[ -n "${SKIP_DOWNLOAD:-}" ]]; then echo "[skip] $name (SKIP_DOWNLOAD is set)" return fi echo "[download] $name → $dest" curl -sfL -o "$dest" "$url" } download "htmx@${HTMX_VERSION}" \ "https://unpkg.com/htmx.org@${HTMX_VERSION}/dist/htmx.min.js" \ "${STATIC_DIR}/htmx.min.js" download "htmx-ext-json-enc@${HTMX_JSON_ENC_VERSION}" \ "https://unpkg.com/htmx-ext-json-enc@${HTMX_JSON_ENC_VERSION}/json-enc.js" \ "${STATIC_DIR}/json-enc.js" download "acme.sh@${ACME_VERSION}" \ "https://raw.githubusercontent.com/acmesh-official/acme.sh/${ACME_VERSION}/acme.sh" \ "vendor/acme.sh" chmod +x "vendor/acme.sh" echo "[done] All libraries vendored."