mirror of
https://github.com/the-draupnir-project/Draupnir.git
synced 2026-05-24 16:25:18 +00:00
Suppress 'config' package's warnings when config file is missing. (#606)
Fixes https://github.com/the-draupnir-project/Draupnir/issues/480. It's confusing people and we don't really use this package properly or rely on it for this anyways.
This commit is contained in:
+6
-1
@@ -11,6 +11,9 @@
|
||||
import * as fs from "fs";
|
||||
import { load } from "js-yaml";
|
||||
import { LogService, RichConsoleLogger } from "matrix-bot-sdk";
|
||||
// Needed for https://github.com/the-draupnir-project/Draupnir/issues/480
|
||||
// sorry buddy...
|
||||
process.env.SUPPRESS_NO_CONFIG_WARNING = "y";
|
||||
import Config from "config";
|
||||
import path from "path";
|
||||
import { SafeModeBootOption } from "./safemode/BootOption";
|
||||
@@ -286,7 +289,9 @@ function getConfigPath(): {
|
||||
}
|
||||
const path = Config.util.getConfigSources().at(-1)?.name;
|
||||
if (path === undefined) {
|
||||
throw new TypeError("No configuration path has been found for Draupnir");
|
||||
throw new TypeError(
|
||||
"No configuration path has been found for Draupnir. Use the --draupnir-config option to provide a path to the config."
|
||||
);
|
||||
}
|
||||
return { isDraupnirPath: false, path };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user