Skip to content

Commit 797f913

Browse files
jarnevrcprl
andauthored
fix(cli): fix API key check condition that breaks Ollama provider (#1748)
* fix(cli): change error check to only fail when params.apiKeyName is missing and skipAuth is not true * fix(cli): add changeset for fixed API key check condition --------- Co-authored-by: Veronica Prilutskaya <veronica@lingo.dev>
1 parent d39918c commit 797f913

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.changeset/thirty-dogs-post.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"lingo.dev": patch
3+
---
4+
5+
Fix API key check condition that breaks the Ollama provider

packages/cli/src/cli/localizer/explicit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function createAiSdkLocalizer(params: {
106106
const skipAuth = params.skipAuth === true;
107107

108108
const apiKey = process.env[params?.apiKeyName ?? ""];
109-
if ((!skipAuth && !apiKey) || !params.apiKeyName) {
109+
if (!skipAuth && (!apiKey || !params.apiKeyName)) {
110110
throw new Error(
111111
dedent`
112112
You're trying to use raw ${chalk.dim(params.id)} API for translation. ${

0 commit comments

Comments
 (0)