mirror of
https://github.com/ApfelTeeSaft/LiveSplitOne.git
synced 2026-08-28 11:53:24 +00:00
This gets rid of the need to use make and thus a unix like shell. You can now just run `npm run build:core` instead. Closes #87
34 lines
712 B
JavaScript
34 lines
712 B
JavaScript
const { spawnSync } = require('child_process');
|
|
const fs = require('fs');
|
|
|
|
spawnSync(
|
|
"cargo",
|
|
["run"],
|
|
{
|
|
cwd: "livesplit-core/capi/bind_gen",
|
|
stdio: "inherit",
|
|
}
|
|
);
|
|
|
|
fs
|
|
.createReadStream("livesplit-core/capi/bindings/wasm/livesplit_core.ts")
|
|
.pipe(fs.createWriteStream("src/livesplit.ts"));
|
|
|
|
spawnSync(
|
|
"cargo",
|
|
[
|
|
"build",
|
|
"-p", "cdylib",
|
|
"--target", "wasm32-unknown-unknown",
|
|
"--release",
|
|
],
|
|
{
|
|
cwd: "livesplit-core",
|
|
stdio: "inherit",
|
|
}
|
|
);
|
|
|
|
fs
|
|
.createReadStream("livesplit-core/target/wasm32-unknown-unknown/release/livesplit_core.wasm")
|
|
.pipe(fs.createWriteStream("src/livesplit_core.wasm"));
|