fix: .env 读取 \r 问题

fix: .env 读取 \r 问题

Merge pull request #243 from ltxhhz/v2
pull/244/head^2
Greper 2024-11-15 23:11:45 +08:00 committed by GitHub
commit 16748a75d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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;