mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 07:37:39 +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 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')});
|
||||||
|
|||||||
Reference in New Issue
Block a user