Allow relative paths for mjolnir data

These are relative to the project directory.
This commit is contained in:
gnuxie 2021-09-09 17:21:13 +01:00
parent 57ef8ab7fe
commit 1d2da60bee

View File

@ -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) {