From 698f9bd965e78eb831fbae363ebbbfab89befb42 Mon Sep 17 00:00:00 2001 From: Romain Cascino <6696530+RomainCscn@users.noreply.github.com> Date: Thu, 21 May 2026 11:09:22 +0000 Subject: [PATCH] Fix CLI_VERSION ReferenceError in pnpm dev Replace raw CLI_VERSION global references in src/index.ts with the getCliVersion() helper from src/version.ts, which safely falls back to "dev" when the build-time define isn't injected. --- src/index.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index ec8d269..ca49631 100644 --- a/src/index.ts +++ b/src/index.ts @@ -26,16 +26,15 @@ import { error, info, setJsonMode, setLogLevel, setStderr, verbose, warn } from import { pluralize } from "./util"; import { buildUserAgent } from "./user-agent"; import { withRetry } from "./retry"; - -declare const CLI_VERSION: string; +import { getCliVersion } from "./version"; if (process.argv.includes("--version") || process.argv.includes("-v")) { - console.log(CLI_VERSION); + console.log(getCliVersion()); process.exit(0); } if (process.argv.includes("--help") || process.argv.includes("-h")) { - console.log(`Linear Release CLI v${CLI_VERSION} + console.log(`Linear Release CLI v${getCliVersion()} Integrate CI/CD pipelines with Linear releases. @@ -102,7 +101,7 @@ function formatVersion(release: { version?: string } | null | undefined): string } const logEnvironmentSummary = () => { - info(`linear-release v${CLI_VERSION}`); + info(`linear-release v${getCliVersion()}`); if (releaseName) { info(`Using custom release name: ${releaseName}`); }