Files
switchmon/config.js
Thomas Ruoff f4ccfe4429 add prettier
2019-11-14 08:41:27 +01:00

22 lines
438 B
JavaScript

'use strict';
const configPath = require('xdg').basedir.configPath('switchmon/config.json');
const defaults = {
postCmd: undefined,
profiles: {}
};
let config = Object.assign({}, defaults);
try {
config = Object.assign(config, require(configPath));
} catch (err) {
if (err.code !== 'MODULE_NOT_FOUND') {
throw err;
}
// No config found in "${configPath}". Using defaults...
}
module.exports = config;