mirror of
https://github.com/certd/certd.git
synced 2026-05-14 20:17:32 +08:00
chore: 1
This commit is contained in:
@@ -31,9 +31,11 @@ export function load(config, env = '') {
|
||||
// Get document, or throw exception on error
|
||||
logger.info('load config', env);
|
||||
const yamlPath = path.join(process.cwd(), `.env.${env}.yaml`);
|
||||
const doc = yaml.load(fs.readFileSync(yamlPath, 'utf8'));
|
||||
_.merge(doc, parseEnv(config));
|
||||
return doc;
|
||||
if (fs.existsSync(yamlPath)) {
|
||||
const doc = yaml.load(fs.readFileSync(yamlPath, 'utf8'));
|
||||
return _.merge(doc, parseEnv(config));
|
||||
}
|
||||
return parseEnv(config);
|
||||
}
|
||||
|
||||
export function mergeConfig(config: any, envType: string) {
|
||||
|
||||
Reference in New Issue
Block a user