diff --git a/tools/perspective-scripts/repack_wheel.mjs b/tools/perspective-scripts/repack_wheel.mjs index 62e5b8ce31..2229a39429 100644 --- a/tools/perspective-scripts/repack_wheel.mjs +++ b/tools/perspective-scripts/repack_wheel.mjs @@ -12,14 +12,20 @@ import { execSync } from "node:child_process"; import * as fs from "node:fs"; +import * as path from "node:path"; +import pkg from "../../package.json" assert { type: "json" }; + +const __dirname = new URL(".", import.meta.url).pathname; const wheel_file = fs.readdirSync(".").filter((x) => x.endsWith(".whl"))[0]; const pkg_name = wheel_file.split("-").slice(0, 2).join("-"); execSync(`wheel unpack ${wheel_file}`); fs.cpSync( - "rust/perspective-python/perspective.data", - `${pkg_name}/perspective.data`, + path.join(__dirname, "../../rust/perspective-python/perspective.data"), + `${pkg_name}/perspective_python-${pkg.version.replace(/-rc\.\d+/, (x) => + x.replace("-", "").replace(".", "") + )}.data`, { recursive: true } );