Skip to content

Commit

Permalink
build: Add icon.png for Linux builds (fixes #507)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliandoran committed Oct 25, 2024
1 parent 0768a2a commit e3e6f56
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions forge.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,20 @@ module.exports = {
afterComplete: [(buildPath, _electronVersion, platform, _arch, callback) => {
const extraResources = getExtraResourcesForPlatform();
for (const resource of extraResources) {
const baseName = path.basename(resource);
let sourcePath;
if (platform === 'darwin') {
sourcePath = path.join(buildPath, `${APP_NAME}.app`, 'Contents', 'Resources', path.basename(resource));
sourcePath = path.join(buildPath, `${APP_NAME}.app`, 'Contents', 'Resources', baseName);
} else {
sourcePath = path.join(buildPath, 'resources', path.basename(resource));
}
const destPath = path.join(buildPath, path.basename(resource));
let destPath;

if (baseName !== "256x256.png") {
destPath = path.join(buildPath, path.basename(resource));
} else {
destPath = path.join(buildPath, "icon.png");
}

// Copy files from resources folder to root
fs.move(sourcePath, destPath)
Expand Down Expand Up @@ -96,6 +103,7 @@ function getExtraResourcesForPlatform() {
case 'darwin':
break;
case 'linux':
resources.push("images/app-icons/png/256x256.png")
for (const script of scripts) {
resources.push(`./bin/tpl/${script}.sh`)
}
Expand Down

0 comments on commit e3e6f56

Please sign in to comment.