Fix resolveBin for windows
See original GitHub issueresolveBin
: https://github.com/kentcdodds/kcd-scripts/blob/bd3d6425598db7f25ee15f14238739abf5b28178/src/utils.js#L21-L44
It’s responsible for taking a module name (like eslint
) and getting a path to the executable binary. If the path to the executable is the same as the one that’s in the $PATH
environment variable (using which
), then we can return the raw binary name itself and execute a script with that, otherwise we’ll return the full path so it’s executed with the full path (because it’s not available in $PATH
presumably.
This is useful because if the user sees the script we run (which they do in some situations) then the script will be shorter.
It works on linux systems right now, but apparently the result of which.sync
is to a file ending in .CMD
and isn’t a symlink (so the realpathSync
doesn’t resolve it to the binary path).
So we need to find a package that will do this for us (I already tried resolve-bin
and it didn’t work the way I want it to) or fix this function up to make it work for windows as well as linux.
Anyone wanna help out?
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (6 by maintainers)
Top GitHub Comments
nice one @kentcdodds !
🎉 This issue has been resolved in version 1.3.1 🎉
The release is available on:
npm package (@latest dist-tag)
Your semantic-release bot 📦🚀