-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix: path for bin files #1107
fix: path for bin files #1107
Conversation
@jdiamond if you have ideas on integration tests for CLI code, I don't have knowledge in that subject. |
also should resolve asyncapi/website#107 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on a fresh check out of master. Running ./bin/mqtt.js
showed the MODULE_NOT_FOUND error. Running npm link
and then mqtt
showed the same.
Checked out this branch and both ./bin/mqtt.js
and mqtt
worked right away. Both mqtt pub
and mqtt sub
work. mqtt pub
fails poorly with no arguments, but that's a different issue.
I don't know the "help-me" package, but it looks like the change you added comes from the main example in its README and it makes sense to me.
The "./.." in require('./../package.json')
looks funny to me (I think the path could just be "../package.json"), but it seems to work. I tested the mqtt version
command from different directories and it seems like it can always find package.json.
LGTM.
Maybe a test could be to use |
@jdiamond I'll add that test before I merge. |
@YoDaMa did you want to merge and add the test after to get this back out and working for users? |
Yeah let’s do that. I was going to get to the tests but I’ve been struggling to get anything done this week. Shit is heavy. |
* fix: addressing * fix: path * chore: remove comments
This is a fix from PR #1096 , which moved some of the CLI functionality into the bin folder.
We need to add some form of integration testing so this doesn't happen again...
Addresses: #1106