mirror of
https://github.com/tomru/switchmon.git
synced 2026-03-02 22:17:23 +01:00
22 lines
438 B
JavaScript
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;
|