-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
Add a new argument to specify a different path for nycrc #724
Add a new argument to specify a different path for nycrc #724
Conversation
LGTM |
1 similar comment
LGTM |
lib/config-util.js
Outdated
@@ -40,7 +40,11 @@ function loadConfig (argv, cwd) { | |||
// that would cause the application to exit early. | |||
Config.buildYargs = function (cwd) { | |||
cwd = guessCWD(cwd) | |||
const config = loadConfig() | |||
const argv = Yargs(process.argv) | |||
.help(false) |
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.
I think we could avoid needing to call Yargs(process.argv)
here if we delay calling this line:
I think we could then swap out the config path in the nyc.js
bin:
https://github.com/igorlima/nyc/blob/486aacc1ba1702c5f10505664cdefaa7368703ef/bin/nyc.js#L21
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.
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.
one comment about avoiding running Yargs()
in config-util.js
. This work is looking great 👍 thank you.
- avoid needing to call Yargs(process.argv) - swap out the config path in the nyc.js bin
Changes Unknown when pulling b01a3f3 on igorlima:add-a-new-argument-to-specify-different-path-for-nycrc into ** on istanbuljs:master**. |
Changes Unknown when pulling 4895ae3 on igorlima:add-a-new-argument-to-specify-different-path-for-nycrc into ** on istanbuljs:master**. |
@bcoe let me know if there's any other concern. Thanks. |
@igorlima thank you for the contribution 😄 |
I'm using the |
This PR allows us to specify a different path for
.nycrc
.Thanks for understanding.