Files
Toju/tools/after-pack.js
T
myxelium 718f4a99f0
Queue Release Build / prepare (push) Successful in 28s
Deploy Web Apps / deploy (push) Failing after 10m14s
Queue Release Build / build-windows (push) Failing after 15m12s
Queue Release Build / build-linux (push) Successful in 43m41s
Queue Release Build / finalize (push) Skipped
Queue Release Build / build-android (push) Successful in 17m25s
fix: AppImage required --no-sandbox
Not tested enough but works on my machine
2026-08-14 03:51:23 +02:00

35 lines
1.0 KiB
JavaScript

const fs = require('fs');
const path = require('path');
const {
buildLinuxLauncherScript,
resolveLinuxLauncherNames
} = require('../dist/electron/app/linux-launcher.rules.js');
const LAUNCHER_MODE = 0o755;
function installLinuxLauncher(appOutDir, executableName) {
const { launcherFileName, binaryFileName } = resolveLinuxLauncherNames(executableName);
const launcherPath = path.join(appOutDir, launcherFileName);
const binaryPath = path.join(appOutDir, binaryFileName);
if (!fs.existsSync(binaryPath)) {
fs.renameSync(launcherPath, binaryPath);
}
fs.writeFileSync(launcherPath, buildLinuxLauncherScript({ binaryFileName }), 'utf8');
fs.chmodSync(launcherPath, LAUNCHER_MODE);
return launcherFileName;
}
exports.default = async function afterPack(context) {
if (context.electronPlatformName !== 'linux') {
return;
}
const launcherFileName = installLinuxLauncher(context.appOutDir, context.packager.executableName);
console.log(` • linux launcher installed file=${launcherFileName}`);
};