diff --git a/scripts/recover-orphaned-processes.sh b/scripts/recover-orphaned-processes.sh index 15c4c6c08aa..65bf55ef5fb 100755 --- a/scripts/recover-orphaned-processes.sh +++ b/scripts/recover-orphaned-processes.sh @@ -11,11 +11,6 @@ # Output: JSON object with `orphaned` array and `ts` timestamp. set -euo pipefail -if ! command -v node &>/dev/null; then - echo '{"error":"node not found on PATH","orphaned":[],"ts":"'"$(date -u +%Y-%m-%dT%H:%M:%SZ)"'"}' - exit 0 -fi - usage() { cat <<'USAGE' Usage: recover-orphaned-processes.sh @@ -34,6 +29,11 @@ if [ "$#" -gt 0 ]; then exit 2 fi +if ! command -v node &>/dev/null; then + echo '{"error":"node not found on PATH","orphaned":[],"ts":"'"$(date -u +%Y-%m-%dT%H:%M:%SZ)"'"}' + exit 0 +fi + node <<'NODE' const { execFileSync } = require("node:child_process"); const fs = require("node:fs");