From 9b7c7e2881d756909af191094bda435ca7ef7e9b Mon Sep 17 00:00:00 2001 From: Jef LeCompte Date: Fri, 11 Dec 2020 08:11:57 -0500 Subject: [PATCH] fix: `.env` backwards compatibility --- src/config.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/config.ts b/src/config.ts index 240cd15b6b..9f656ea585 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,10 +1,9 @@ +import {existsSync, readFileSync} from 'fs'; import {banner} from './banner'; - import dotenv from 'dotenv'; import path from 'path'; -import {readFileSync} from 'fs'; -if (path.resolve(__dirname, '../dotenv').length > 0) { +if (existsSync(path.resolve(__dirname, '../dotenv'))) { dotenv.config({path: path.resolve(__dirname, '../dotenv')}); } else { dotenv.config({path: path.resolve(__dirname, '../.env')});