Skip to content

Commit

Permalink
cli option to set configPath
Browse files Browse the repository at this point in the history
  • Loading branch information
f0x52 committed Oct 8, 2024
1 parent 85cbb72 commit 60e76e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions server/command-line/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ const program = new Command("start");
program
.description("Start the server")
.option("--dev", "Development mode with hot module reloading")
.option("--configPath <file>", "config file path")
.on("--help", Utils.extraHelp)
.action(function (options) {
if (options.configPath !== undefined) {
Config.configPath = options.configPath;
}

initalizeConfig();

const newLocal = "../server";
Expand Down
4 changes: 2 additions & 2 deletions server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ class Config {
path.join(__dirname, "..", "defaults", "config.js")
)) as ConfigType;
#homePath = "";
configPath: string | undefined;
networks: {[name: string]: TemplateNetwork} = this.parseNetworks();

getHomePath() {
return this.#homePath;
}

getConfigPath() {
return path.join(this.#homePath, "config.js");
// return "/etc/thelounge/config.js";
return this.configPath ?? path.join(this.#homePath, "config.js");
}

getUserLogsPath() {
Expand Down

0 comments on commit 60e76e4

Please sign in to comment.