Skip to content

Commit

Permalink
Fix semver check (#1144)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdesmet authored May 20, 2024
1 parent 7a2feee commit 4191b42
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
23 changes: 9 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,7 @@
"parse-diff": "^0.11.1",
"python-bridge": "github:mdesmet/node-python-bridge#feat/detached",
"reflect-metadata": "^0.2.2",
"semver": "^7.6.2",
"which": "^4.0.0",
"yaml": "^2.4.2"
},
Expand Down
8 changes: 2 additions & 6 deletions src/dbt_client/dbtCloudIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { existsSync } from "fs";
import { ValidationProvider } from "../validation_provider";
import { DeferToProdService } from "../services/deferToProdService";
import { ProjectHealthcheck } from "./dbtCoreIntegration";
import semver = require("semver");

function getDBTPath(
pythonEnvironment: PythonEnvironment,
Expand Down Expand Up @@ -88,13 +89,8 @@ export class DBTCloudDetection implements DBTDetection {
const regex = /dbt Cloud CLI - (\d*\.\d*\.\d*)/gm;
const matches = regex.exec(stdout);
if (matches?.length === 2) {
const version = matches[1].split(".");
const minVersion = "0.37.6";
if (
parseInt(version[0]) <= 0 &&
parseInt(version[1]) <= 37 &&
parseInt(version[2]) <= 6
) {
if (semver.lt(matches[1], minVersion)) {
window.showErrorMessage(
`This version of dbt Cloud is not supported. Please update to a dbt Cloud CLI version higher than ${minVersion}`,
);
Expand Down

0 comments on commit 4191b42

Please sign in to comment.