Feat: allow users to change dotenv file with env var

This facilitates the usage of docker secrets for the keys/tokens.
This commit is contained in:
JoaoCostaIFG 2024-07-06 01:01:39 +01:00
parent 29b61cc0b6
commit 3d7a85843f
No known key found for this signature in database
GPG key ID: E85A047FEBBA3E93

View file

@ -5,7 +5,7 @@ import path from 'path';
import xbytes from 'xbytes'; import xbytes from 'xbytes';
import {ConditionalKeys} from 'type-fest'; import {ConditionalKeys} from 'type-fest';
import {ActivityType, PresenceStatusData} from 'discord.js'; 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'); export const DATA_DIR = path.resolve(process.env.DATA_DIR ? process.env.DATA_DIR : './data');