2021-12-25 14:39:47 +01:00
|
|
|
const path = require('path')
|
2024-05-08 13:16:23 +02:00
|
|
|
const shell = require("shelljs")
|
2021-12-25 14:39:47 +01:00
|
|
|
|
|
|
|
const runShellCommand = (appOutDir) => {
|
2024-05-08 13:16:23 +02:00
|
|
|
shell.exec(
|
|
|
|
`chmod 4755 ${path.join(appOutDir, "chrome-sandbox")}`,
|
|
|
|
|
|
|
|
function (code, stdout, stderr) {
|
|
|
|
console.log('runShellCommand ==> Exit code:', code)
|
|
|
|
if (stderr) {
|
|
|
|
console.log('runShellCommand ==> Program stderr:', stderr)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
2021-12-25 14:39:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
async function doLinux(context) {
|
2024-05-08 13:16:23 +02:00
|
|
|
console.log("Running doLinux ==> ")
|
2021-12-25 14:39:47 +01:00
|
|
|
|
2024-05-08 13:16:23 +02:00
|
|
|
const { targets, appOutDir } = context
|
2021-12-25 14:39:47 +01:00
|
|
|
|
2024-05-08 13:16:23 +02:00
|
|
|
targets.forEach(async target => {
|
|
|
|
if (!["appimage", "snap"].includes(target.name.toLowerCase())) {
|
|
|
|
await runShellCommand(appOutDir)
|
|
|
|
}
|
|
|
|
})
|
2021-12-25 14:39:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
async function afterPack(context) {
|
2024-05-08 13:16:23 +02:00
|
|
|
console.log("Running AfterPack")
|
2021-12-25 14:39:47 +01:00
|
|
|
|
2024-05-08 13:16:23 +02:00
|
|
|
const electronPlatformName = context.electronPlatformName.toLowerCase()
|
2021-12-25 14:39:47 +01:00
|
|
|
|
2024-05-08 13:16:23 +02:00
|
|
|
if (electronPlatformName.includes("linux")) {
|
|
|
|
await doLinux(context)
|
|
|
|
}
|
2021-12-25 14:39:47 +01:00
|
|
|
}
|
|
|
|
|
2024-05-08 13:16:23 +02:00
|
|
|
module.exports = afterPack
|