Skip to content

fix(scripts): build-art path resolution on Windows#7

Closed
nanami-he wants to merge 1 commit into
mainfrom
fix/build-art-windows-path
Closed

fix(scripts): build-art path resolution on Windows#7
nanami-he wants to merge 1 commit into
mainfrom
fix/build-art-windows-path

Conversation

@nanami-he
Copy link
Copy Markdown
Owner

Surfaced while running bun run build on Win11 (the build:art step blocks any local install that needs to regenerate dist/):

ENOENT: no such file or directory, open '\C:\Users\...\statusline\pet-status.sh'

new URL(".", import.meta.url).pathname returns /C:/... on Windows (POSIX-style with leading slash). join()-ing that with a relative segment produced \C:\... which fs.readFileSync then failed to open.

Fix: switched to dirname(fileURLToPath(import.meta.url)) — the same pattern already used in cli/index.js and cli/openclaw-patch.ts. Same anti-pattern, same shape of fix as #6.

This was the second commit on the original fix/find-package-root-windows-infinite-loop branch but didn't make it into the squash-merge of #6 / v0.4.3. Splitting it out as its own PR.

Test plan

  • bun run build on Win11 — full pipeline succeeds, writes dist/, statusline/pet-status.sh, ~/.petsonality/reactions-pool.json
  • bun test — 305 pass, 0 fail (no impact)
  • macOS — confirm no regression in the happy path

🤖 Generated with Claude Code

`new URL(".", import.meta.url).pathname` returns "/C:/..." on Windows
(POSIX-style with leading slash). join()-ing that with a relative segment
produced "\C:\..." which fs() then failed to open with ENOENT. This
blocked `bun run build` on Windows, which in turn blocked any local
install that needs to regenerate dist/.

Switched to `dirname(fileURLToPath(import.meta.url))` — same pattern the
rest of the codebase already uses (cli/index.js, cli/openclaw-patch.ts).

Surfaced while running the full build pipeline on Win11 to test the
findPackageRoot fix from the same branch.
@nanami-he
Copy link
Copy Markdown
Owner Author

closing in favor of #12@Lwhieldon got there too with the same fileURLToPath fix as part of his golden retriever PR. his version is going in instead so the credit lands on him. thanks for the convergent diagnosis though :)

@nanami-he nanami-he closed this Apr 29, 2026
nanami-he pushed a commit that referenced this pull request Apr 29, 2026
…ows path (#12)

- Redesigned golden retriever ASCII art into a front-facing friendly dog face (matches the 10-pet front-facing convention; old side-profile read as a dinosaur to a real golden retriever owner)
- pet_pet now returns a full renderPetCard wrapped in a code fence so `/pet pet` shows a visual in VSCode integrated terminal where the bash statusline hook does not run
- build-art.ts: fileURLToPath replaces `new URL(".", import.meta.url).pathname` which returned `/C:/...` on Windows, causing ENOENT on the statusline write (same fix that was independently in #7, now closed in favor of this PR)

Closes #10.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant