fix: allow --help without node

This commit is contained in:
Joey Krug
2026-02-13 05:44:06 +00:00
committed by Gustavo Madeira Santana
parent 18ca984bff
commit 3a1bb339e4

View File

@@ -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");