Skip to content
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 subcommands not working if files are implicit '.js' but command is ran without '.js' #785

Closed
NEO97online opened this issue Apr 6, 2018 · 4 comments
Assignees
Labels
bug Commander is not working as intended

Comments

@NEO97online
Copy link

NEO97online commented Apr 6, 2018

If your command files use the .js extension, but you run the command via node mycommand instead of node mycommand.js, any git-style sub-commands will fail in Command.prototype#executeSubCommand

This failure is on line 531, column 15 of index.js:

var f = argv[1];

// ...

link = fs.lstatSync(f).isSymbolicLink() ? fs.readlinkSync(f) : f;

Specifically this part is failing:

fs.lstatSync(f)

This is causing an error because Commander is looking for the file that corresponds to argv[1], so in this specific case, argv[1] doesn't match the actual file name.

@shadowspawn
Copy link
Collaborator

Reproduced the problem, but there is an easy work-around to specify the full filename.

This issue has not had any activity in over six months. It isn't likely to get acted on due to this report.

Feel free to open a new issue if it comes up again, with new information and renewed interest.

Thank you for your contributions.

@NEO97online
Copy link
Author

@shadowspawn I'm willing to work on a PR for this if you re-open and assign to me. It shouldn't be difficult to fix.

@shadowspawn
Copy link
Collaborator

Done. Thanks.

@shadowspawn shadowspawn added the bug Commander is not working as intended label Aug 18, 2019
@shadowspawn
Copy link
Collaborator

Inactive for a few months. Closing again.

This issue matches the wording of the title in #512, but is a much more specific case. Also has some similarities with #1044.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Commander is not working as intended
Projects
None yet
Development

No branches or pull requests

2 participants