← back to Astek Landing

scripts/run-data-refresh.sh

11 lines

#!/bin/bash
# Dependency-guarded wrapper for the astek-data-refresh cron (TK-11162 fix).
# The cron plist used to call `node build-products-json.js` directly with no
# install step, so a missing/wiped node_modules crashed it silently every
# time with no self-healing. This wraps it: npm ci (deterministic, matches
# package-lock.json, ~1s when already installed) then the real script.
set -euo pipefail
cd "$(dirname "$0")/.."
/opt/homebrew/bin/npm ci --omit=dev --no-audit --no-fund
exec /opt/homebrew/bin/node scripts/build-products-json.js