From b902febd32c98411c96127e8688b4335c768fa09 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Fri, 13 Dec 2024 04:30:33 +0000 Subject: [PATCH] =?UTF-8?q?refactor:=20=E2=99=BB=EF=B8=8F=20optimize=20mod?= =?UTF-8?q?elAliases=20processing=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/cli/src/nodehost.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/cli/src/nodehost.ts b/packages/cli/src/nodehost.ts index 00ccae4df..24a4d7d2e 100644 --- a/packages/cli/src/nodehost.ts +++ b/packages/cli/src/nodehost.ts @@ -205,6 +205,9 @@ export class NodeHost implements RuntimeHost { async readConfig(): Promise { const config = await resolveGlobalConfiguration(this.dotEnvPath) const { envFile, modelAliases } = config + if (modelAliases) + for (const kv of Object.entries(modelAliases)) + this.setModelAlias("config", kv[0], kv[1]) if (existsSync(envFile)) { if (resolve(envFile) !== resolve(DOT_ENV_FILENAME)) logVerbose(`.env: loading ${envFile}`) @@ -216,9 +219,6 @@ export class NodeHost implements RuntimeHost { if (res.error) throw res.error } await parseDefaultsFromEnv(process.env) - if (modelAliases) - for (const kv of Object.entries(modelAliases)) - this.setModelAlias("config", kv[0], kv[1]) return config }