Skip to content

Commit 60e76e4

Browse files
committed
cli option to set configPath
1 parent 85cbb72 commit 60e76e4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

server/command-line/start.ts

+5
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ const program = new Command("start");
1010
program
1111
.description("Start the server")
1212
.option("--dev", "Development mode with hot module reloading")
13+
.option("--configPath <file>", "config file path")
1314
.on("--help", Utils.extraHelp)
1415
.action(function (options) {
16+
if (options.configPath !== undefined) {
17+
Config.configPath = options.configPath;
18+
}
19+
1520
initalizeConfig();
1621

1722
const newLocal = "../server";

server/config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,15 @@ class Config {
135135
path.join(__dirname, "..", "defaults", "config.js")
136136
)) as ConfigType;
137137
#homePath = "";
138+
configPath: string | undefined;
138139
networks: {[name: string]: TemplateNetwork} = this.parseNetworks();
139140

140141
getHomePath() {
141142
return this.#homePath;
142143
}
143144

144145
getConfigPath() {
145-
return path.join(this.#homePath, "config.js");
146-
// return "/etc/thelounge/config.js";
146+
return this.configPath ?? path.join(this.#homePath, "config.js");
147147
}
148148

149149
getUserLogsPath() {

0 commit comments

Comments
 (0)