Refactored binary (adding features)
- Now allows the specification of a configuration file with --config - Make the default JSON config file output look neater with less code (plus added a newline at EOF) - Removed non-ECMA standard 'const' (mostly to keep jshint happy) - Tucked configuration vars into an object so the values could be accessed in helper functions with the reference in their closures - Created helper functions where code was duplicated - Use path.dirname to eliminate the need to maintain a configPath - Got rid of configPathExists and configFileExists variables, the caching advantage (of up to one call) wasn't worth the awkwardness of maintaining them once the config file became parameterized. - Moved the proclamation of what environment is used to after the config file gets loaded, it seemed silly to say "using environment 'production'" followed by "Type --help for usage information" on a no-op.
Showing
with
83 additions
and
72 deletions
-
Please register or sign in to post a comment