fix-sandbox

This commit is contained in:
stark81
2026-04-11 16:01:06 +08:00
parent 33fc4f768c
commit 3f31278131
2 changed files with 10 additions and 1 deletions

9
fix-sandbox.js Normal file
View File

@@ -0,0 +1,9 @@
const { execSync } = require('child_process');
if (process.platform === 'linux') {
// You need to make sure that
// /home/runner/work/VutronMusic/VutronMusic/node_modules/electron/dist/chrome-sandbox
// is owned by root and has mode 4755.
execSync('sudo chown root:root ./node_modules/electron/dist/chrome-sandbox');
execSync('sudo chmod 4755 ./node_modules/electron/dist/chrome-sandbox');
}

View File

@@ -17,7 +17,7 @@
"dev": "electron-vite dev",
"dev:web": "vite dev",
"build": "electron-vite build",
"postinstall": "electron-builder install-app-deps",
"postinstall": "node fix-sandbox.js && electron-builder install-app-deps",
"build:unpack": "npm run build && electron-builder --dir",
"build:win": "npm run build && electron-builder --win --publish never",
"build:mac": "npm run build && electron-builder --mac --x64 --publish never && cp dist/latest-mac.yml dist/latest-mac-x64.yml && electron-builder --mac --arm64 --publish never && cp dist/latest-mac.yml dist/latest-mac-arm64.yml && node scripts/merge_latest_mac_yml.mjs dist/latest-mac-x64.yml dist/latest-mac-arm64.yml dist/latest-mac.yml",