hypertwist/scripts/run-hypertwist-gitnexus-status.sh
2026-06-22 23:24:30 +00:00

23 lines
714 B
Bash

#!/usr/bin/env bash
set -euo pipefail
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
local_gitnexus_cli="$repo_root/mirrors/GitNexus/gitnexus/dist/cli/index.js"
analysis_root="$repo_root/.gitnexus-source-only-root"
if [[ ! -d "$analysis_root" ]]; then
echo "No HyperTwist GitNexus source-only analysis root exists yet. Run scripts/run-hypertwist-gitnexus-analyze.sh first." >&2
exit 1
fi
cd "$analysis_root"
if [[ -f "$local_gitnexus_cli" ]]; then
if node "$local_gitnexus_cli" status "$@" 2>/dev/null; then
exit 0
fi
echo "Local retained GitNexus CLI was not runnable on this host. Falling back to npx gitnexus@latest." >&2
fi
exec npx -y gitnexus@latest status "$@" 2>/dev/null