mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 06:27:38 +00:00
feat: add command parameter to set custom dotenv conf (#1590)
This commit is contained in:
+11
-1
@@ -3,7 +3,17 @@ import {banner} from './banner';
|
||||
import dotenv from 'dotenv';
|
||||
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')});
|
||||
} else {
|
||||
dotenv.config({path: path.resolve(__dirname, '../.env')});
|
||||
|
||||
Reference in New Issue
Block a user