Browse Source

Fix dotenv now.json option behaviour (#304)

master
Tim Neutkens 8 years ago
committed by Leo Lamprecht
parent
commit
dd8cc832cd
  1. 11
      bin/now-deploy.js

11
bin/now-deploy.js

@ -372,13 +372,16 @@ async function sync(token) {
const now = new Now(apiUrl, token, {debug})
let dotenvConfig
let dotenvOption
if (argv.dotenv) {
if (nowConfig.dotenv) {
argv.dotenv = nowConfig.dotenv
}
dotenvOption = argv.dotenv
} else if (nowConfig && nowConfig.dotenv) {
dotenvOption = nowConfig.dotenv
}
const dotenvFileName = typeof argv.dotenv === 'string' ? argv.dotenv : '.env'
if (dotenvOption) {
const dotenvFileName = typeof dotenvOption === 'string' ? dotenvOption : '.env'
if (!fs.existsSync(dotenvFileName)) {
error(`--dotenv flag is set but ${dotenvFileName} file is missing`)

Loading…
Cancel
Save