mirror of
https://github.com/siddharthvaddem/openscreen.git
synced 2026-08-29 03:08:30 +08:00
15 lines
657 B
JavaScript
15 lines
657 B
JavaScript
// electron-builder beforePack hook: ensure the auto-caption assets (Whisper model + ORT wasm) exist
|
|
// before packaging, so the `caption-assets` extraResources entry has something to copy. Runs for
|
|
// every package invocation — local `npm run build:*` and CI's bare `electron-builder` alike. The
|
|
// fetch script is idempotent, so this is a no-op once the assets are present.
|
|
|
|
const { execFileSync } = require("node:child_process");
|
|
const path = require("node:path");
|
|
|
|
exports.default = async function beforePack() {
|
|
execFileSync("node", [path.join(__dirname, "fetch-caption-model.mjs")], {
|
|
stdio: "inherit",
|
|
cwd: path.join(__dirname, ".."),
|
|
});
|
|
};
|