New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Git-style sub-commands not working on Windows #890
Comments
It's just how sub-command execution works. If you look at that line of code Line 526 in d240081
it concatenates current executing filename and args[0] ( sub-command ). So what you are talking about is not a bug neither feature. |
@erolkskn the bug seems to be that the behavior is incorrect in windows but correct in linux. Example:
and git actually points to /blah/index.js, on linux, it would try to call
on windows, it calls
On top of that, in windows, the path of where git-commit.js is seems to be incorrect. |
Can you share your code with us ? If you can we can help you better, thanks. |
me too git-style no support yarn global |
The yarn issue may have been fixed in: https://github.com/tj/commander.js/releases/tag/v2.20.0 |
Hello, I have updated to v2.20.0 and I am still having this problem. Is there a workaround or a resolution for this? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
.command now supports the executableFile option (thanks to @abetomo). |
It looks like due to how Yarn v1.12.3/npm v6.4.1 handle bins compared to linux/mac, the sub-commands are not working.
index should be the bin name, but it becomes the js file name
legion is the subcommand I am trying to run
It's trying to require the file in the root directory, but it should be searching in the folder that the bin was ran.
I traced it to line 569 inside of index.js of commander.
Is anyone else getting this or is it just something stupid I am doing? If it is an issue, I would be willing to make a PR. atm, I'm not sure how I can grab the bin file name though since I can't find it anywhere I've looked, including the process.argv.
The text was updated successfully, but these errors were encountered: