Skip to content

Commit

Permalink
Add fallback to VSCODE_CLI_VERSION when resolving CLI version in conf…
Browse files Browse the repository at this point in the history
…ig.ts
  • Loading branch information
pelikhan committed Sep 24, 2024
1 parent 7453886 commit ef3c944
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/vscode/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import {
VSCODE_CONFIG_CLI_PATH,
VSCODE_CONFIG_CLI_VERSION,
} from "../../core/src/constants"
import { CORE_VERSION } from "../../core/src/version"
import { CORE_VERSION, VSCODE_CLI_VERSION } from "../../core/src/version"
import { semverParse, semverSatisfies } from "../../core/src/semver"

export async function resolveCli() {
const config = vscode.workspace.getConfiguration(TOOL_ID)
const cliPath = config.get(VSCODE_CONFIG_CLI_PATH) as string
const cliVersion =
(config.get(VSCODE_CONFIG_CLI_VERSION) as string) || CORE_VERSION
(config.get(VSCODE_CONFIG_CLI_VERSION) as string) ||
VSCODE_CLI_VERSION ||
CORE_VERSION
const gv = semverParse(CORE_VERSION)
if (!semverSatisfies(cliVersion, ">=" + gv.major + "." + gv.minor))
vscode.window.showWarningMessage(
Expand Down

0 comments on commit ef3c944

Please sign in to comment.