Skip to content

Commit 5ce634d

Browse files
committed
feat: reuse i18n cmd inside ci cmd
1 parent 0657399 commit 5ce634d

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

.changeset/long-plants-love.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+
reuse i18n inside ci cmd

packages/cli/src/cli/cmd/ci/flows/in-branch.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { execSync } from "child_process";
22
import path from "path";
33
import { gitConfig, IntegrationFlow } from "./_base";
4+
import i18nCmd from "../../i18n";
45

56
export class InBranchFlow extends IntegrationFlow {
67
async preRun() {
@@ -55,10 +56,16 @@ export class InBranchFlow extends IntegrationFlow {
5556
}
5657

5758
private async runLingoDotDev() {
58-
execSync(
59-
`npx lingo.dev@latest i18n --api-key ${this.platformKit.config.replexicaApiKey}`,
60-
{ stdio: "inherit" },
61-
);
59+
try {
60+
await i18nCmd
61+
.exitOverride()
62+
.parseAsync(["--api-key", this.platformKit.config.replexicaApiKey], {
63+
from: "user",
64+
});
65+
} catch (err: any) {
66+
if (err.code === "commander.helpDisplayed") return;
67+
throw err;
68+
}
6269
}
6370

6471
private configureGit() {

0 commit comments

Comments
 (0)