mirror of
https://github.com/thelounge/thelounge
synced 2024-11-23 20:43:08 +00:00
Merge pull request #461 from thelounge/xpaw/check-config
Only load config if it exists
This commit is contained in:
commit
51666b6db6
1 changed files with 5 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
var _ = require("lodash");
|
||||
var path = require("path");
|
||||
var os = require("os");
|
||||
var fs = require("fs");
|
||||
|
||||
var Helper = {
|
||||
config: null,
|
||||
|
@ -25,8 +26,10 @@ function setHome(homePath) {
|
|||
this.USERS_PATH = path.join(this.HOME, "users");
|
||||
|
||||
// Reload config from new home location
|
||||
var userConfig = require(this.CONFIG_PATH);
|
||||
this.config = _.extend(this.config, userConfig);
|
||||
if (fs.existsSync(this.CONFIG_PATH)) {
|
||||
var userConfig = require(this.CONFIG_PATH);
|
||||
this.config = _.extend(this.config, userConfig);
|
||||
}
|
||||
}
|
||||
|
||||
function getUserConfigPath(name) {
|
||||
|
|
Loading…
Reference in a new issue