mirror of
https://github.com/certd/certd.git
synced 2026-04-14 12:30:54 +08:00
fix: .env 读取 \r 问题
fix: .env 读取 \r 问题 Merge pull request #243 from ltxhhz/v2
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user