Skip to content

Commit 4f8a4e7

Browse files
committed
fix postinstall step for cloudflare
1 parent 4ec8eb2 commit 4f8a4e7

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"build:prod": "electron-vite build --mode production",
2626
"coverage": "vitest run --coverage",
2727
"test": "vitest",
28-
"postinstall": "electron-builder install-app-deps"
28+
"postinstall": "node ./postinstall.cjs"
2929
},
3030
"devDependencies": {
3131
"@eslint/js": "^8.57.0",

postinstall.cjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const skip =
2+
process.env.WAVETERM_SKIP_APP_DEPS === "1" || process.env.CF_PAGES === "1" || process.env.CF_PAGES === "true";
3+
4+
if (skip) {
5+
console.log("postinstall: skipping electron-builder install-app-deps");
6+
process.exit(0);
7+
}
8+
9+
import("child_process").then(({ execSync }) => {
10+
execSync("electron-builder install-app-deps", { stdio: "inherit" });
11+
});

0 commit comments

Comments
 (0)