- #!/usr/bin/env bash
- # One-time setup: LOCAL gltf-transform install used by optimize_glb.sh to shrink
- # reconstructed glbs for the browser walkthrough. Kept out of the app venv and the
- # global npm prefix so @gltf-transform/core is deduped to ONE copy — a split core
- # between two separate global installs dies with "null.getLogger". Run on deploy.
- set -euo pipefail
- DIR="${GENRECON_GLTFTOOL_DIR:-/opt/genrecon/gltftool}"
- mkdir -p "$DIR"; cd "$DIR"
- [ -f package.json ] || npm init -y -s >/dev/null
- npm install @gltf-transform/cli@4.4.0 @gltf-transform/functions@4.4.0 --no-fund --no-audit
- echo "gltf-transform ready: $DIR/node_modules/.bin/gltf-transform"
|