Skip to content

Commit cb2ad99

Browse files
authored
Suppress 'config' package's warnings when config file is missing. (#606)
Fixes #480. It's confusing people and we don't really use this package properly or rely on it for this anyways.
1 parent 4015543 commit cb2ad99

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
import * as fs from "fs";
1212
import { load } from "js-yaml";
1313
import { LogService, RichConsoleLogger } from "matrix-bot-sdk";
14+
// Needed for https://github.com/the-draupnir-project/Draupnir/issues/480
15+
// sorry buddy...
16+
process.env.SUPPRESS_NO_CONFIG_WARNING = "y";
1417
import Config from "config";
1518
import path from "path";
1619
import { SafeModeBootOption } from "./safemode/BootOption";
@@ -286,7 +289,9 @@ function getConfigPath(): {
286289
}
287290
const path = Config.util.getConfigSources().at(-1)?.name;
288291
if (path === undefined) {
289-
throw new TypeError("No configuration path has been found for Draupnir");
292+
throw new TypeError(
293+
"No configuration path has been found for Draupnir. Use the --draupnir-config option to provide a path to the config."
294+
);
290295
}
291296
return { isDraupnirPath: false, path };
292297
}

0 commit comments

Comments
 (0)