Skip to content

fix: remove normalisation of commands#118

Merged
43081j merged 2 commits intomainfrom
fix-relative-goodness
Apr 28, 2026
Merged

fix: remove normalisation of commands#118
43081j merged 2 commits intomainfrom
fix-relative-goodness

Conversation

@43081j
Copy link
Copy Markdown
Member

@43081j 43081j commented Apr 28, 2026

This removes normalize(...) around a command as I suspect this is a
bug.

Basically, x('./foo') would result in x('foo') as far as I can tell.
Which means the OS will search PATH for foo rather than calling
exactly the one in cwd.

This has existed since the beginning of tinyexec, so it doesn't seem to
be a noticed bug. I also can't think of a reason we need to normalize
since Windows and cross-spawn handle slashes, relative resolution, etc.

This removes `normalize(...)` around a command as I suspect this is a
bug.

Basically, `x('./foo')` would result in `x('foo')` as far as I can tell.
Which means the OS will search `PATH` for `foo` rather than calling
exactly the one in `cwd`.

This has existed since the beginning of tinyexec, so it doesn't seem to
be a noticed bug. I also can't think of a reason we need to `normalize`
since Windows and cross-spawn handle slashes, relative resolution, etc.
@43081j 43081j force-pushed the fix-relative-goodness branch from 253224c to 59b92f9 Compare April 28, 2026 14:46
@43081j
Copy link
Copy Markdown
Member Author

43081j commented Apr 28, 2026

@iiroj and @AriPerkkio if i publish a pre-release of this, any chance you could confirm it doesn't break any tests on your end?

this code was here since the start so there's no reasoning why we ever did it. im fairly confident its fine to be removed but would be nice to know some consumers have tried it

@iiroj
Copy link
Copy Markdown
Contributor

iiroj commented Apr 28, 2026

@43081j sure, we can run lint-staged CI tests in a MR.

@43081j 43081j merged commit 66f2038 into main Apr 28, 2026
8 checks passed
@43081j 43081j deleted the fix-relative-goodness branch April 28, 2026 16:28
@43081j
Copy link
Copy Markdown
Member Author

43081j commented Apr 28, 2026

i've published a pre-release here:
https://www.npmjs.com/package/tinyexec/v/1.1.2-next.0

you can use tinyexec@next

let me know if all is well 🙏

@AriPerkkio
Copy link
Copy Markdown
Member

AriPerkkio commented Apr 28, 2026

Vitest CI passing:

@iiroj
Copy link
Copy Markdown
Contributor

iiroj commented Apr 29, 2026

Lint-staged tests also pass, but I don't think they hit this scenario.

@43081j
Copy link
Copy Markdown
Member Author

43081j commented Apr 29, 2026

although it is fixing on scenario, it changes a branch all calls hit. thats what i was more concerned about.

so, given both are passing i think im happy to release it 👍 meanwhile, i did prove that the new tests fail in main (showing that the fix works).

thanks so much to both of you for testing it 🙏

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.

3 participants