From 3d7a85843fc4c8028ac87a0e5df98c477f2fffc1 Mon Sep 17 00:00:00 2001 From: JoaoCostaIFG Date: Sat, 6 Jul 2024 01:01:39 +0100 Subject: [PATCH] Feat: allow users to change dotenv file with env var This facilitates the usage of docker secrets for the keys/tokens. --- src/services/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/config.ts b/src/services/config.ts index b6b9aea..019df07 100644 --- a/src/services/config.ts +++ b/src/services/config.ts @@ -5,7 +5,7 @@ import path from 'path'; import xbytes from 'xbytes'; import {ConditionalKeys} from 'type-fest'; import {ActivityType, PresenceStatusData} from 'discord.js'; -dotenv.config(); +dotenv.config({path: process.env.ENV_FILE ?? path.resolve(process.cwd(), '.env')}); export const DATA_DIR = path.resolve(process.env.DATA_DIR ? process.env.DATA_DIR : './data');