mirror of
https://github.com/garrytan/gstack.git
synced 2026-07-20 22:40:58 +02:00
fix(gbrain): probe CLI without command builtin
This commit is contained in:
@@ -429,15 +429,6 @@ function constrainSourceId(prefix: string, raw: string): string {
|
||||
return tail ? `${prefix}-${tail}-${hash}` : `${prefix}-${hash}`;
|
||||
}
|
||||
|
||||
function gbrainAvailable(): boolean {
|
||||
try {
|
||||
execSync("command -v gbrain", { stdio: "ignore" });
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// ── Lock file (D1) ─────────────────────────────────────────────────────────
|
||||
|
||||
interface LockInfo {
|
||||
@@ -529,9 +520,6 @@ async function runCodeImport(args: CliArgs): Promise<StageResult> {
|
||||
if (!root) {
|
||||
return { name: "code", ran: false, ok: true, duration_ms: 0, summary: "skipped (not in git repo)" };
|
||||
}
|
||||
if (!gbrainAvailable()) {
|
||||
return { name: "code", ran: false, ok: false, duration_ms: 0, summary: "skipped (gbrain CLI not in PATH)" };
|
||||
}
|
||||
|
||||
const sourceId = deriveCodeSourceId(root);
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ import {
|
||||
rmSync,
|
||||
} from "fs";
|
||||
import { join, basename, dirname } from "path";
|
||||
import { execSync, execFileSync, spawnSync, spawn, type ChildProcess } from "child_process";
|
||||
import { execFileSync, spawnSync, spawn, type ChildProcess } from "child_process";
|
||||
import { homedir } from "os";
|
||||
import { createHash } from "crypto";
|
||||
|
||||
@@ -809,7 +809,6 @@ let _gbrainAvailability: boolean | null = null;
|
||||
function gbrainAvailable(): boolean {
|
||||
if (_gbrainAvailability !== null) return _gbrainAvailability;
|
||||
try {
|
||||
execSync("command -v gbrain", { stdio: "ignore" });
|
||||
// Probe `--help` for the `import` subcommand. gbrain v0.20.0+ ships
|
||||
// `import <dir>` (batch markdown import via path-authoritative slugs).
|
||||
// If absent, we surface a single clean error here rather than failing
|
||||
|
||||
Reference in New Issue
Block a user