Skip to content

Commit 2089e8c

Browse files
timbesstexodus
authored andcommitted
Fix data directory name for qualified versions
1 parent ca5cc0d commit 2089e8c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tools/perspective-scripts/repack_wheel.mjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,20 @@
1212

1313
import { execSync } from "node:child_process";
1414
import * as fs from "node:fs";
15+
import * as path from "node:path";
16+
import pkg from "../../package.json" assert { type: "json" };
17+
18+
const __dirname = new URL(".", import.meta.url).pathname;
1519

1620
const wheel_file = fs.readdirSync(".").filter((x) => x.endsWith(".whl"))[0];
1721
const pkg_name = wheel_file.split("-").slice(0, 2).join("-");
1822
execSync(`wheel unpack ${wheel_file}`);
1923

2024
fs.cpSync(
21-
"rust/perspective-python/perspective.data",
22-
`${pkg_name}/perspective.data`,
25+
path.join(__dirname, "../../rust/perspective-python/perspective.data"),
26+
`${pkg_name}/perspective_python-${pkg.version.replace(/-rc\.\d+/, (x) =>
27+
x.replace("-", "").replace(".", "")
28+
)}.data`,
2329
{ recursive: true }
2430
);
2531

0 commit comments

Comments
 (0)