Skip to content

Commit 79d258d

Browse files
feat(cli): Update header docs link to be conditional for CI environments (#1616)
* feat(cli): update header docs link for CI environments * chore: add changeset
1 parent d76b729 commit 79d258d

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

.changeset/bright-timers-hear.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
"react-router-app": patch
3+
"@replexica/integration-directus": patch
4+
"vite-project": patch
5+
"@lingo.dev/_compiler": patch
6+
"@lingo.dev/_locales": patch
7+
"@lingo.dev/_logging": patch
8+
"@lingo.dev/_react": patch
9+
"adonis": patch
10+
"next-app": patch
11+
"@lingo.dev/_spec": patch
12+
"lingo.dev": patch
13+
"@lingo.dev/_sdk": patch
14+
"docs": patch
15+
"replexica": patch
16+
"@replexica/sdk": patch
17+
---
18+
19+
Update CLI header to conditionally link to ci or cli docs.

packages/cli/src/cli/utils/ui.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import figlet from "figlet";
33
import { vice } from "gradient-string";
44
import readline from "readline";
55
import { colors } from "../constants";
6+
import fs from "fs"; // <-- ADD THIS IMPORT
7+
8+
function isCI(): boolean {
9+
return Boolean(process.env.CI) || fs.existsSync("/.dockerenv");
10+
}
611

712
export async function renderClear() {
813
console.log("\x1Bc");
@@ -37,10 +42,17 @@ export async function renderHero() {
3742
const label3 = "🎮 Join Discord:";
3843
const maxLabelWidth = 17; // Approximate visual width accounting for emoji
3944

45+
// --- ADD THIS LOGIC ---
46+
const isCIEnv = isCI(); // <-- USE THE LOCAL HELPER FUNCTION
47+
const docsUrl = isCIEnv
48+
? "https://lingo.dev/ci"
49+
: "https://lingo.dev/cli";
50+
// ------------------------
51+
4052
console.log(
4153
`${chalk.hex(colors.blue)(label1.padEnd(maxLabelWidth + 1))} ${chalk.hex(
4254
colors.blue,
43-
)("https://lingo.dev/go/docs")}`,
55+
)(docsUrl)}`,
4456
); // Docs emoji seems narrower
4557
console.log(
4658
`${chalk.hex(colors.blue)(label2.padEnd(maxLabelWidth))} ${chalk.hex(

0 commit comments

Comments
 (0)