From 8c8db8ecf85d977d08db1413d86d85d25e930592 Mon Sep 17 00:00:00 2001 From: tim neutkens Date: Sun, 12 Feb 2017 13:11:22 +0100 Subject: [PATCH] Allow dotenv option in now.json --- bin/now-deploy.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/now-deploy.js b/bin/now-deploy.js index d4e054b..5292af4 100755 --- a/bin/now-deploy.js +++ b/bin/now-deploy.js @@ -372,8 +372,9 @@ async function sync(token) { const now = new Now(apiUrl, token, {debug}) let dotenvConfig - if (argv.dotenv) { - const dotenvFileName = typeof argv.dotenv === 'string' ? argv.dotenv : '.env' + const dotenvOption = argv.dotenv ? argv.dotenv : nowConfig.dotenv + if (dotenvOption) { + const dotenvFileName = typeof dotenvOption === 'string' ? dotenvOption : '.env' if (!fs.existsSync(dotenvFileName)) { error(`--dotenv flag is set but ${dotenvFileName} file is missing`)