Merge pull request #1412 from chaotixkilla/fix-environment-helper-to-default

Fix environment helper to use default .env path
This commit is contained in:
Rafael Taranto 2022-10-14 12:06:45 +01:00 committed by GitHub
commit 68a52248c0
3 changed files with 3 additions and 4 deletions

View file

@ -1,2 +1 @@
const path = require('path')
require('dotenv').config({ path: process.env.NODE_ENV === 'production' ? path.resolve('/etc', 'lamassu', '.env') : path.resolve(__dirname, '../.env') })
require('dotenv').config()

View file

@ -57,7 +57,7 @@ function updateOptionBasepath (result, optionName) {
async function run () {
// load current opts
const options = load().opts
const shouldMigrate = !fs.existsSync(process.env.NODE_ENV === 'production' ? path.resolve('/etc', 'lamassu', '.env') : path.resolve(__dirname, '../.env'))
const shouldMigrate = !fs.existsSync(path.resolve(__dirname, '../.env'))
// write the resulting .env
if (shouldMigrate) {