Skip to content

Commit

Permalink
Use config-load module to load config
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Jul 18, 2015
1 parent 93a37de commit fd60b61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/overlook.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var pathModule = require('path'),
fs = require('fs-extra-promise'),
promisifyAny = require('promisify-any'),
requireFolderTree = require('require-folder-tree'),
configLoad = require('config-load'),
walkFolderTree = require('walk-folder-tree');

// imports
Expand Down Expand Up @@ -69,14 +70,7 @@ module.exports = promisifyAny.generators({
this.log('Loading config from ' + configPath);

if (configPath && fs.existsSync(configPath)) {
var config = requireFolderTree(configPath);

if (config.env && config.env[this.env]) {
_.merge(config, config.env[this.env]);
config = _.clone(config);
delete config.env;
}

var config = configLoad(configPath, {env: this.env});
_.merge(options, config);
}

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"bluebird": "^2.9.31",
"co-bluebird": "^0.1.0",
"co-series": "^0.1.0",
"config-load": "^0.1.0",
"ejs": "^2.3.2",
"express": "^4.13.0",
"expressor": "^2.1.1",
Expand Down

0 comments on commit fd60b61

Please sign in to comment.