Skip to content

Commit

Permalink
fix: check dotenv file path
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirasaki committed Jun 12, 2023
1 parent 5bb8687 commit cc71231
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Importing from packages
require('dotenv').config();
const { existsSync } = require('fs');
require('dotenv').config({ path: existsSync('.env') ? '.env' : '.env.example' });
const logger = require('@mirasaki/logger');
const chalk = require('chalk');
const {
Expand Down Expand Up @@ -267,7 +268,7 @@ logger.success(`Finished initializing after ${ getRuntime(initTimerStart).ms } m
if (USE_API === 'true') require('./server/');

// Exit before initializing listeners in test mode
if (modeArg && modeArg.endsWith('test')) process.exit(1);
if (modeArg && modeArg.endsWith('test')) process.exit(0);

(async () => {
// If you don't want to use all of the extractors and register only the required ones manually, use
Expand Down

0 comments on commit cc71231

Please sign in to comment.