-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Take -version from package.json #48
Comments
Agreed, I'd love this. |
+1 |
sebastiendb
added a commit
to sebastiendb/commander.js
that referenced
this issue
May 4, 2012
sebastiendb
added a commit
to sebastiendb/commander.js
that referenced
this issue
May 4, 2012
tj
added a commit
that referenced
this issue
Jul 3, 2012
Issue #48 : Take -version from package.json
just realized this is implemented wrong, you'll get commander's version every time |
your require() is always relative to commander's |
For others finding this issue: you know where the package.json is in your project, so you can just do: program
.version(require('./package.json').version) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
E.g.
But a test is needed for the existence of package.json, I think the 2 most used locations are and /.
So 1, check for
main_module_dir/package.json
and 2, check formain_module_dir/../package.json
.The text was updated successfully, but these errors were encountered: