Skip to content

fix: setup script uses mv, which doesn't exist under Windows cmd.exe - #249

Open
si-kui-a wants to merge 1 commit into
enuchi:mainfrom
si-kui-a:fix/setup-script-windows-mv
Open

si-kui-a wants to merge 1 commit into
enuchi:mainfrom
si-kui-a:fix/setup-script-windows-mv

Conversation

@si-kui-a

Copy link
Copy Markdown

Fixes #156.

yarn run setup fails on Windows with "'mv' is not recognized as an internal or external command" right after clasp create succeeds, leaving .clasp.json stuck in dist/ instead of at the repo root where clasp push/yarn deploy expect it.

I saw in the issue thread that the Vite migration was expected to remove the need for mv but didn't fully resolve it, and that a Windows-only move workaround was suggested — that would trade the Windows breakage for breaking mv on macOS/Linux. This uses fs.renameSync instead, which works identically on every platform Node runs on. Kept it dependency-free (no new package) since it's a one-line rename and Node is already a hard prerequisite here.

Test plan

  • Reproduced the exact cmd.exe failure, confirmed the fix works identically under cmd.exe and POSIX shells.
  • npm run build still succeeds end to end.

Co-authored with Claude Code (Anthropic); reviewed by @si-kui-a before submission.

`yarn run setup` fails on Windows with "'mv' is not recognized as an
internal or external command" right after `clasp create` succeeds,
leaving `.clasp.json` stuck in `dist/` instead of at the repo root
where `clasp push`/`yarn deploy` expect it.

Saw in the issue thread that the Vite migration was expected to
remove the need for `mv` but didn't fully resolve it, and that a
Windows-only `move` workaround was suggested -- that would trade the
Windows breakage for breaking `mv` on macOS/Linux. This uses
`fs.renameSync` instead, which works identically on every platform
Node runs on. Kept it dependency-free (no new package) since it's a
one-line rename and Node is already a hard prerequisite here.

Fixes enuchi#156.

Verified: reproduced the exact cmd.exe failure, confirmed the fix
works identically under cmd.exe and POSIX shells, and confirmed
`npm run build` still succeeds end to end.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Reviewed-by: si-kui-a
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.

'mv' is not recognized as an internal or external command

1 participant