add optional config for postCmd

This commit is contained in:
Thomas Ruoff
2016-03-01 13:54:14 +01:00
parent 511b972c22
commit 242a12d12a
4 changed files with 56 additions and 6 deletions

17
config.js Normal file
View File

@@ -0,0 +1,17 @@
'use strict';
const configPath = require('xdg').basedir.configPath('switchmon/config.json');
const defaults = {
postCmd: undefined,
};
let config = Object.assign({}, defaults);
try {
config = Object.assign(config, require(configPath));
} catch(err) {
// No config found in "${configPath}". Using defaults...
}
module.exports = config;