-
Notifications
You must be signed in to change notification settings - Fork 428
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
Report actual version on the relaxed --version
command.
#49
Conversation
This is better than reporting '0.0.1' for everything, or hardcoding it in `src/index.js` since people might forget to update it on release.
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.
Exactly what I thought about, good change 👍
Definitely a nice fix! |
I would also prefer |
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.
require(./package.json)
is sufficient and preferred.
src/index.js
Outdated
@@ -10,7 +10,7 @@ const converters = require('./converters.js') | |||
|
|||
var input, output | |||
|
|||
const version = JSON.parse(fs.readFileSync('./package.json')).version | |||
const version = require('../package.json').version |
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.
Why the now different path?
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.
The path looks for one folder above since (on my machine), the relaxed commands points to /usr/local/lib/node_modules/relaxedjs/src/index.js
while package.json
is located in /usr/local/lib/node_modules/relaxedjs/package.json
.
I tested it locally to make sure if it works. Let me know if there are problems with this, and I will try to test it in more situations.
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.
You are right, the binary points to src/index.js
https://github.com/RelaxedJS/ReLaXed/blob/master/package.json#L7
changed as per request. |
This is better than reporting '0.0.1' for everything, or hardcoding it in
src/index.js
since people might forget to update it on release.