Skip to content

Commit

Permalink
Merge pull request #635 from Half-Shot/hs/fixes
Browse files Browse the repository at this point in the history
Check port *after* loading the config
  • Loading branch information
Half-Shot authored Dec 1, 2020
2 parents 2aaaab0 + b5859ab commit 6efedfe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/discordas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,17 @@ async function run() {
}

const config = new DiscordBridgeConfig();
const port = opts.port || config.bridge.port;
if (!port) {
throw Error("Port not given in command line or config file");
}
const readConfig = yaml.safeLoad(fs.readFileSync(configPath, "utf8"));
if (typeof readConfig !== "object") {
throw Error("Config is not of type object");
}
config.applyConfig(readConfig);
config.applyEnvironmentOverrides(process.env);
Log.Configure(config.logging);
const port = opts.port || config.bridge.port;
if (!port) {
throw Error("Port not given in command line or config file");
}
if (config.database.roomStorePath || config.database.userStorePath) {
log.error("The keys 'roomStorePath' and/or 'userStorePath' is still defined in the config. " +
"Please see docs/bridge-migrations.md on " +
Expand Down

0 comments on commit 6efedfe

Please sign in to comment.