mirror of
https://github.com/thelounge/thelounge
synced 2024-11-10 06:34:21 +00:00
Warn if user configuration being loaded is empty
This commit is contained in:
parent
a8fb892873
commit
206ded55ff
1 changed files with 8 additions and 1 deletions
|
@ -79,7 +79,14 @@ function setHome(newPath) {
|
|||
|
||||
// Reload config from new home location
|
||||
if (fs.existsSync(configPath)) {
|
||||
var userConfig = require(configPath);
|
||||
const userConfig = require(configPath);
|
||||
|
||||
if (_.isEmpty(userConfig)) {
|
||||
log.warn(`The file located at ${colors.green(configPath)} does not appear to expose anything.`);
|
||||
log.warn(`Make sure it is non-empty and the configuration is exported using ${colors.bold("module.exports = { ... }")}.`);
|
||||
log.warn("Using default configuration...");
|
||||
}
|
||||
|
||||
this.config = _.merge(this.config, userConfig);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue