fix: .env 读取 \r 问题

pull/243/head
ltxhhz 2024-11-15 20:34:38 +08:00
parent b4b9f33b2c
commit 0e33dfa019
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ export function mergeConfig(config: any, envType: string) {
export function loadDotEnv() {
const envStr = fs.readFileSync('.env').toString();
envStr.split('\n').forEach(line => {
const [key, value] = line.split('=');
const [key, value] = line.trim().split('=');
const oldValue = process.env[key];
if (!oldValue) {
process.env[key] = value;