Persist npm path for user services
This commit is contained in:
@@ -20,8 +20,19 @@ BACKEND_HOST="${CLAW_BACKEND_HOST:-127.0.0.1}"
|
||||
BACKEND_PORT="${CLAW_BACKEND_PORT:-8765}"
|
||||
FRONTEND_HOST="${CLAW_FRONTEND_HOST:-0.0.0.0}"
|
||||
FRONTEND_PORT="${CLAW_FRONTEND_PORT:-3000}"
|
||||
NPM_BIN="${CLAW_NPM_BIN:-$(command -v npm || true)}"
|
||||
|
||||
if [[ -n "${CLAW_NODE_BIN_DIR:-}" ]]; then
|
||||
export PATH="${CLAW_NODE_BIN_DIR}:${PATH}"
|
||||
fi
|
||||
|
||||
if [[ -z "${NPM_BIN}" || ! -x "${NPM_BIN}" ]]; then
|
||||
echo "npm not found for frontend service." >&2
|
||||
echo "Run deploy again from a shell where npm is available: bash scripts/deploy-ubuntu.sh" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export CLAW_API_URL="${CLAW_API_URL:-http://${BACKEND_HOST}:${BACKEND_PORT}}"
|
||||
|
||||
cd "${ROOT_DIR}/frontend/app"
|
||||
exec npm run start -- --hostname "${FRONTEND_HOST}" --port "${FRONTEND_PORT}"
|
||||
exec "${NPM_BIN}" run start -- --hostname "${FRONTEND_HOST}" --port "${FRONTEND_PORT}"
|
||||
|
||||
Reference in New Issue
Block a user