- Notifications
You must be signed in to change notification settings - Fork318
Add custom --config option#163
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
codecov-io commentedMay 6, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report
@@ Coverage Diff @@## master #163 +/- ##===========================================- Coverage 83.72% 38.26% -45.47%=========================================== Files 7 7 Lines 338 345 +7 ===========================================- Hits 283 132 -151- Misses 55 213 +158
Continue to review full report at Codecov.
|
lib/src/_utils.js Outdated
| if(customFilename){ | ||
| returnrequireConfig(Path.join(path,customFilename))||{}; | ||
| }else{ | ||
| returngetFileTypes() |
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.
What do you think about about:
return[].concat(customFilename,getFileTypes()).reduce()||{};
So that, if the user passes a wrong configuration file, gren will still look for existing ones.
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.
Good call! Since the user is passing a specific config filename in, they're expecting the file to exist — do you think it'd be more user-friendly to throw an error here and notify them that the file wasn't found?
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.
Definitely! I think we either check if other configuration files exist or we throw an error - as logging something in red in the console - which is still a good solution for me.
alexcanessa commentedDec 12, 2019
@all-contributors please add@kyeah for code |
I've put upa pull request to add@kyeah! 🎉 |
Closes#152.
Adds a
--configoption to specify a custom configuration file, e.g.Note that a plain grenrc file can only contain one
., so--custom=.custom.grenrcwill be parsed incorrectly (see the checkhere). I left it alone for now, but if you have a preference for how it should behave, let me know 👋