From 5f0de768c32753b70d341fb743f21fb9923dd0fa Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Mon, 13 Feb 2017 14:36:35 +0100 Subject: [PATCH] No need to specify `--dotenv` --- bin/now-deploy.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/now-deploy.js b/bin/now-deploy.js index e2a6dd3..2136925 100755 --- a/bin/now-deploy.js +++ b/bin/now-deploy.js @@ -372,9 +372,13 @@ async function sync(token) { const now = new Now(apiUrl, token, {debug}) let dotenvConfig - const dotenvOption = argv.dotenv ? argv.dotenv : nowConfig.dotenv - if (dotenvOption) { - const dotenvFileName = typeof dotenvOption === 'string' ? dotenvOption : '.env' + + if (argv.dotenv) { + if (nowConfig.dotenv) { + argv.dotenv = nowConfig.dotenv + } + + const dotenvFileName = typeof argv.dotenv === 'string' ? argv.dotenv : '.env' if (!fs.existsSync(dotenvFileName)) { error(`--dotenv flag is set but ${dotenvFileName} file is missing`)