Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
#12: Merge global and local config
  • Loading branch information
attiks committed Aug 15, 2017
commit cd0e6beac6ec48e0ca47c21dce992d3dddf13b27
5 changes: 4 additions & 1 deletion include/file-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const config = require('./config');
const yaml = require('read-yaml');
const hash = require('hash-sum');
const Fs = require('./filesystem');
const extend = require('util')._extend;

/**
* file config with local and global configuration files
Expand Down Expand Up @@ -45,7 +46,9 @@ class fileConfig extends config {
*/
parseLocal() {
try {
return yaml.sync(this.local, {});
let global = yaml.sync(this.global, {});
let local = yaml.sync(this.local, {});
return extend(global, local);
} catch (e) {
console.log(`Error parsing configuration: "${this.local}"`);
process.exit(1);
Expand Down