feat: add command parameter to set custom dotenv conf (#1590)

This commit is contained in:
pbaum83
2021-01-17 11:47:33 -06:00
committed by GitHub
parent 2fa893795f
commit b03d24217f
+11 -1
View File
@@ -3,7 +3,17 @@ import {banner} from './banner';
import dotenv from 'dotenv'; import dotenv from 'dotenv';
import path from 'path'; import path from 'path';
if (existsSync(path.resolve(__dirname, '../dotenv'))) { if (process.env.npm_config_conf) {
if (
existsSync(path.resolve(__dirname, '../' + process.env.npm_config_conf))
) {
dotenv.config({
path: path.resolve(__dirname, '../' + process.env.npm_config_conf)
});
} else {
dotenv.config({path: path.resolve(__dirname, '../.env')});
}
} else if (existsSync(path.resolve(__dirname, '../dotenv'))) {
dotenv.config({path: path.resolve(__dirname, '../dotenv')}); dotenv.config({path: path.resolve(__dirname, '../dotenv')});
} else { } else {
dotenv.config({path: path.resolve(__dirname, '../.env')}); dotenv.config({path: path.resolve(__dirname, '../.env')});