Skip to content

Fix #45; quote set command to allow special chars in paths - #188

Closed
the-can-of-soup wants to merge 1 commit into
npm:mainfrom
the-can-of-soup:fix-issue-45
Closed

the-can-of-soup wants to merge 1 commit into
npm:mainfrom
the-can-of-soup:fix-issue-45

Conversation

@the-can-of-soup

Copy link
Copy Markdown

Summary

Paths containing certain special characters cause unexpected behavior. Fixed by quoting the SET command.

References

Fixes #45
Reopens #53

Comment by owlstronaut saying to reopen a pull request if the issue is still relevant

@the-can-of-soup
the-can-of-soup requested a review from a team as a code owner August 6, 2026 03:19
@ashrafiucse

Copy link
Copy Markdown

Hey — I hit the same bug last week (through a Playwright issue where someone had & in their folder name) and made the exact same change before I noticed this PR was already here.

I went ahead and opened #189 with the fix as well. The difference is I added a windows-only test that actually executes a shim from a dir & name path — everything else in the suite just snapshots the generated files, so nothing would've caught this class of regression.

One gotcha worth knowing if you'd rather keep pushing yours: the snapshot that actually needs regenerating is tap-snapshots/test/basic.js.test.cjs, not tap-snapshots/test-basic.js-TAP.test.js. That second file looks live but it's leftover from an older tap version, so as-is CI would still compare against the unquoted SET dp0=%~dp0 in the real snapshot and fail. npx tap --snapshot regenerates it.

Happy with either one getting merged, just want this to finally land after 6 years 🙂

@the-can-of-soup

Copy link
Copy Markdown
Author

Oh, no problem at all! To be honest I just searched for the code and quoted the SET command as a quick-fix, and found #53 had done this before so just copied its changes. Glad to see someone make a more proper fix. 👍

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.

[BUG] *.CMD shims don't work when they are in paths containing shell metachars

2 participants