fix(test): also try findRepoRoot from cwd for A2UI path resolution
This commit is contained in:
parent
ee51dec46c
commit
0cdaf9803c
@ -51,8 +51,8 @@ async function resolveA2uiRoot(): Promise<string | null> {
|
|||||||
if (process.execPath) {
|
if (process.execPath) {
|
||||||
candidates.unshift(path.resolve(path.dirname(process.execPath), "a2ui"));
|
candidates.unshift(path.resolve(path.dirname(process.execPath), "a2ui"));
|
||||||
}
|
}
|
||||||
// Find repo root by walking up from `here` (handles vitest/vite transforms).
|
// Find repo root by walking up from `here` or cwd (handles vitest/vite transforms).
|
||||||
const repoRoot = await findRepoRoot(here);
|
const repoRoot = (await findRepoRoot(here)) ?? (await findRepoRoot(process.cwd()));
|
||||||
if (repoRoot) {
|
if (repoRoot) {
|
||||||
candidates.push(path.resolve(repoRoot, "src/canvas-host/a2ui"));
|
candidates.push(path.resolve(repoRoot, "src/canvas-host/a2ui"));
|
||||||
candidates.push(path.resolve(repoRoot, "dist/canvas-host/a2ui"));
|
candidates.push(path.resolve(repoRoot, "dist/canvas-host/a2ui"));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user