fix(FN-4927): guard project-root helper drift in extension
Fusion-Task-Id: FN-4927 Fusion-Task-Lineage: 8ef39a69-8f1f-4ffe-9d6b-1b752756751d
This commit is contained in:
committed by
gsxdsm
parent
b99298d559
commit
887705c81d
@@ -67,8 +67,16 @@ const MIME_TYPES: Record<string, string> = {
|
||||
".xml": "application/xml",
|
||||
};
|
||||
|
||||
let warnedMissingProjectRootResolver = false;
|
||||
|
||||
function resolveProjectRoot(cwd: string): string {
|
||||
const worktreeProjectRoot = getProjectRootFromWorktree(cwd);
|
||||
const worktreeProjectRoot = typeof getProjectRootFromWorktree === "function"
|
||||
? getProjectRootFromWorktree(cwd)
|
||||
: null;
|
||||
if (typeof getProjectRootFromWorktree !== "function" && !warnedMissingProjectRootResolver) {
|
||||
warnedMissingProjectRootResolver = true;
|
||||
console.warn("[fusion-extension] @fusion/core.getProjectRootFromWorktree is unavailable; using filesystem fallback resolution.");
|
||||
}
|
||||
if (worktreeProjectRoot && existsSync(join(worktreeProjectRoot, ".fusion"))) {
|
||||
return worktreeProjectRoot;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user