Skip to content

Commit

Permalink
Fix data directory name for qualified versions
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Stein <steinlink@gmail.com>
  • Loading branch information
timbess authored and texodus committed Aug 4, 2024
1 parent ca5cc0d commit 94b8f9a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tools/perspective-scripts/repack_wheel.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
);

Expand Down

0 comments on commit 94b8f9a

Please sign in to comment.