File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,17 @@ set -euo pipefail
55driver_repo=$( pwd)
66kernel_repo=${DATABRICKS_SQL_KERNEL_REPO:- ../ ../ databricks-sql-kernel}
77napi_dir=" ${kernel_repo} /napi"
8- napi_major=$( sed -nE ' s/^napi = \{ version = "([0-9]+).*/\1/p' " ${napi_dir} /Cargo.toml" )
8+ napi_major=$(
9+ cargo metadata --format-version 1 --locked --manifest-path " ${napi_dir} /Cargo.toml" |
10+ node -e '
11+ const metadata = JSON.parse(require("fs").readFileSync(0, "utf8"));
12+ const rootId = metadata.resolve.root ?? metadata.workspace_members[0];
13+ const root = metadata.resolve.nodes.find(({ id }) => id === rootId);
14+ const napiId = root?.deps.find(({ name }) => name === "napi")?.pkg;
15+ const version = metadata.packages.find(({ id }) => id === napiId)?.version;
16+ process.stdout.write(version?.split(".")[0] ?? "");
17+ '
18+ )
919
1020# napi-rs v2 and v3 derive macros expect different CLI environment variables.
1121case " ${napi_major} " in
You can’t perform that action at this time.
0 commit comments