#!/usr/bin/env bash hypertwist_gitnexus_probe_local_runtime() { local repo_root="$1" local local_gitnexus_dir="$repo_root/mirrors/GitNexus/gitnexus" local local_gitnexus_cli="$local_gitnexus_dir/dist/cli/index.js" if [[ ! -f "$local_gitnexus_cli" ]]; then return 1 fi if [[ "${HYPERTWIST_GITNEXUS_SKIP_LOCAL_CLI:-0}" == "1" ]]; then echo "Skipping local retained GitNexus CLI because HYPERTWIST_GITNEXUS_SKIP_LOCAL_CLI=1." >&2 return 1 fi local probe_output="" local probe_exit=0 set +e probe_output="$( cd "$local_gitnexus_dir" && node --input-type=module -e 'try { await import("@ladybugdb/core"); } catch (error) { const code = error?.code ? `${error.code}: ` : ""; const message = error?.message || String(error); console.error(`${code}${message}`); process.exit(1); }' 2>&1 )" probe_exit=$? set -e if [[ "$probe_exit" -eq 0 ]]; then return 0 fi probe_output="${probe_output//$'\n'/ }" echo "Local retained GitNexus runtime is not usable on this host (${probe_output}). Falling back to npx gitnexus@latest." >&2 return 1 }