From 1d2da60bee79c8b7fa9f55abf5b8a67ce6612700 Mon Sep 17 00:00:00 2001 From: gnuxie Date: Thu, 9 Sep 2021 17:21:13 +0100 Subject: [PATCH] Allow relative paths for mjolnir data These are relative to the project directory. --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index f9293e26..7b92a412 100644 --- a/src/index.ts +++ b/src/index.ts @@ -45,7 +45,8 @@ if (config.health.healthz.enabled) { } (async function () { - const storage = new SimpleFsStorageProvider(path.join(config.dataPath, "bot.json")); + const storagePath = path.isAbsolute(config.dataPath) ? config.dataPath : path.join(__dirname, '../', config.dataPath) + const storage = new SimpleFsStorageProvider(path.join(storagePath, "bot.json")); let client: MatrixClient; if (config.pantalaimon.use) {