Skip to content

Commit

Permalink
fix: override CLI version for testing (#965)
Browse files Browse the repository at this point in the history
Co-authored-by: Maxi Gimenez <[email protected]>
  • Loading branch information
clample and maxigimenez authored Sep 3, 2024
1 parent 2630e9e commit 2ae8856
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/cli/src/commands/baseCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export abstract class BaseCommand extends Command {
let version = process.env.CHECKLY_CLI_VERSION ?? this.config.version

// use latest version from NPM if it's running from the local environment or E2E
if (version === '0.0.1-dev') {
if (version === '0.0.1-dev' || version?.startsWith('0.0.0')) {
try {
const { data: packageInformation } = await axios.get('https://registry.npmjs.org/checkly/latest')
this.log(`\nNotice: replacing version '${version}' with latest '${packageInformation.version}'.\n`)
this.log(`\nNotice: replacing version '${version}' with latest '${packageInformation.version}'. If you wish to test with a different version, please pass the CHECKLY_CLI_VERSION environment variable.\n`)
version = packageInformation.version
} catch { }
}
Expand Down

0 comments on commit 2ae8856

Please sign in to comment.