refactor: deduplicate projectRoot() — single source in commands.ts (#1197)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
TÂCHES 2026-03-18 11:20:14 -06:00 committed by GitHub
parent f99189d410
commit 9cbd179bf9

View file

@ -20,15 +20,7 @@ import {
} from "./doctor.js";
import { loadPrompt } from "./prompt-loader.js";
import { isAutoActive } from "./auto.js";
import { resolveProjectRoot } from "./worktree.js";
import { assertSafeDirectory } from "./validate-directory.js";
/** Resolve the effective project root, accounting for worktree paths. */
function projectRoot(): string {
const root = resolveProjectRoot(process.cwd());
assertSafeDirectory(root);
return root;
}
import { projectRoot } from "./commands.js";
function dispatchDoctorHeal(pi: ExtensionAPI, scope: string | undefined, reportText: string, structuredIssues: string): void {
const workflowPath = process.env.GSD_WORKFLOW_PATH ?? join(process.env.HOME ?? "~", ".pi", "GSD-WORKFLOW.md");