fix: .env 读取 \r 问题

fix: .env 读取 \r 问题

Merge pull request #243 from ltxhhz/v2
This commit is contained in:
Greper
2024-11-15 23:11:45 +08:00
committed by GitHub

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;