mirror of
https://github.com/certd/certd.git
synced 2026-05-16 13:17:29 +08:00
chore: basic 从pipeline中移除
This commit is contained in:
@@ -10,7 +10,7 @@ import { UserEntity } from '../modules/sys/authority/entity/user.js';
|
||||
import { PipelineEntity } from '../modules/pipeline/entity/pipeline.js';
|
||||
//import { logger } from '../utils/logger';
|
||||
// load .env file in process.cwd
|
||||
import { mergeConfig } from './loader.js';
|
||||
import { loadDotEnv, mergeConfig } from './loader.js';
|
||||
import { libServerEntities } from '@certd/lib-server';
|
||||
import { commercialEntities } from '@certd/commercial-core';
|
||||
import { tmpdir } from 'node:os';
|
||||
@@ -123,6 +123,8 @@ const development = {
|
||||
contactLink: '',
|
||||
},
|
||||
} as MidwayConfig;
|
||||
loadDotEnv();
|
||||
|
||||
mergeConfig(development, 'development');
|
||||
|
||||
mergeConfig(development, env);
|
||||
|
||||
@@ -46,3 +46,14 @@ export function mergeConfig(config: any, envType: string) {
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
||||
export function loadDotEnv() {
|
||||
const envStr = fs.readFileSync('.env').toString();
|
||||
envStr.split('\n').forEach(line => {
|
||||
const [key, value] = line.split('=');
|
||||
const oldValue = process.env[key];
|
||||
if (!oldValue) {
|
||||
process.env[key] = value;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user