mirror of
https://github.com/tomru/switchmon.git
synced 2026-03-03 06:27:23 +01:00
add optional config for postCmd
This commit is contained in:
17
config.js
Normal file
17
config.js
Normal 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;
|
||||
Reference in New Issue
Block a user