Skip to content

Commit cd0e6be

Browse files
committed
kriskbx#12: Merge global and local config
1 parent 20abf15 commit cd0e6be

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

include/file-config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const config = require('./config');
44
const yaml = require('read-yaml');
55
const hash = require('hash-sum');
66
const Fs = require('./filesystem');
7+
const extend = require('util')._extend;
78

89
/**
910
* file config with local and global configuration files
@@ -45,7 +46,9 @@ class fileConfig extends config {
4546
*/
4647
parseLocal() {
4748
try {
48-
return yaml.sync(this.local, {});
49+
let global = yaml.sync(this.global, {});
50+
let local = yaml.sync(this.local, {});
51+
return extend(global, local);
4952
} catch (e) {
5053
console.log(`Error parsing configuration: "${this.local}"`);
5154
process.exit(1);

0 commit comments

Comments
 (0)