Bugfix: crashes when no config file detected

It was looking for a (nonexistent, obsolete) variable to check if
the "config" command is running. Now, it just looks at the
command-line options directly and does it.
This commit is contained in:
Badri Sunderarajan 2020-05-04 13:57:09 +05:30
parent 51b7dcf49a
commit 299369b363

View file

@ -80,7 +80,7 @@ let config = convict({
userConfig = path.join(os.homedir(), '.config/seance.yaml')
if (fs.existsSync(userConfig)) {
config.loadFile(userConfig)
} else if (!runSetup) {
} else if (process.argv[2] != 'setup') {
console.warn(
'Warning: no config file detected! ' +
'Please run `seance setup` to configure your system'
@ -102,4 +102,3 @@ allConf = config.getProperties()
allConf.validated = validated
module.exports = allConf