Skip to content

Commit 942e8d5

Browse files
dmealingclaude
andcommitted
fix(site): --out printed a repo-relative path for a directory outside the repo
`relative(REPO, OUT)` is true and useless once the target is elsewhere: rendering into a temp directory reported `../../tmp/mo-ref-out-XXXX/site-reference/ is fresh`. The label now falls back to the absolute path whenever the relative one escapes the repo, and the default path still reads `site-reference/`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NynrRND6ZUwGvq3ZUTCfxG
1 parent 1875867 commit 942e8d5

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎scripts/build-site-reference.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,13 @@ function resolveOut(): string {
6262
return out;
6363
}
6464
const OUT = resolveOut();
65-
/** How the messages below name the target — `site-reference/` on the default path. */
66-
const label = `${relative(REPO, OUT) || OUT}/`;
65+
/**
66+
* How the messages below name the target — `site-reference/` on the default path, and an
67+
* absolute path for anything outside the repo (a repo-relative `../../tmp/x` would be
68+
* true and useless).
69+
*/
70+
const rel = relative(REPO, OUT);
71+
const label = rel !== "" && !rel.startsWith("..") ? `${rel}/` : OUT;
6772

6873
/** Every file under `dir`, repo-relative, sorted. */
6974
function walk(dir: string, root: string = dir): string[] {

0 commit comments

Comments
 (0)