-
Notifications
You must be signed in to change notification settings - Fork 670
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
Cache loaded config and merge it with defaults #387
Conversation
} | ||
|
||
Helper.config.host = program.host || process.env.IP || Helper.config.host; |
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.
... Do we want to keep ENV here?
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 don't really see a use for it. I would get rid of it. I think the only cases we should use environment variables is for things that can't be in the config file (so, the config path).
dc16643
to
b0431af
Compare
I'm not really sure why you needed to change getConfig, surely you could have stored config as a private variable, and getConfig just returned config. That would have meant a lot less code changes. |
@YaManicKill There are not enough |
@xPaw At least 6 of the 9 files that are edited are edited only because you removed the function. It's not exactly like a getter is less efficient, anyway. What's the point in changing that? |
@YaManicKill Some of the files were changed to remove default fallbacks (e.g. Other files kept it's own stored cached configs (like |
Actually since this is JS it doesn't matter much as objects are always references, so either way you get the same thing in the end. Another option to make this all shorter could be to do |
Looks fine to me, so I will 👍 and we can improve later. I'm not a fan of using "Helper.config" everywhere and would rather have |
Fine, whatever. I don't really care enough, I just didn't see the point. So, whatever. 👍 and merging. |
Cache loaded config and merge it with defaults
Fixes #249