diff --git a/fix-sandbox.js b/fix-sandbox.js new file mode 100644 index 0000000..cca78cd --- /dev/null +++ b/fix-sandbox.js @@ -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'); +} diff --git a/package.json b/package.json index b873b8a..e5419c5 100644 --- a/package.json +++ b/package.json @@ -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",