1
This commit is contained in:
@@ -7,6 +7,7 @@ const apiServerExePath = resolve(
|
||||
repoRoot,
|
||||
'server-rs/target/debug/api-server.exe',
|
||||
);
|
||||
const shellEnvKeys = new Set(Object.keys(process.env));
|
||||
|
||||
function loadEnvFile(path, target) {
|
||||
if (!existsSync(path)) {
|
||||
@@ -26,7 +27,9 @@ function loadEnvFile(path, target) {
|
||||
}
|
||||
|
||||
const [, key, rawValue] = match;
|
||||
if (target[key] !== undefined) {
|
||||
// 只保留启动命令行和外层 shell 已显式传入的环境变量优先级;
|
||||
// `.env.local` 需要能覆盖 `.env`,否则本地短信登录会被默认 false 压住。
|
||||
if (shellEnvKeys.has(key)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user