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
Not tested enough but works on my machine
35 lines
1.0 KiB
JavaScript
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}`);
|
|
};
|