setup_gltftool.sh 657 B

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