Skip to content

Commit

Permalink
Merge pull request thelounge#461 from thelounge/xpaw/check-config
Browse files Browse the repository at this point in the history
Only load config if it exists
  • Loading branch information
astorije authored Jul 4, 2016
2 parents 0bf97e5 + 5cc928d commit fcb5f2a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/helper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var _ = require("lodash");
var path = require("path");
var os = require("os");
var fs = require("fs");

var Helper = {
config: null,
Expand All @@ -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) {
Expand Down

0 comments on commit fcb5f2a

Please sign in to comment.