build: Fix app name in Electron Forge hook

This commit is contained in:
Elian Doran 2024-08-11 06:57:34 +03:00
parent edebe8f7c6
commit 94340ab1a1
No known key found for this signature in database

View File

@ -1,20 +1,22 @@
const path = require('path'); const path = require('path');
const fs = require('fs-extra'); const fs = require('fs-extra');
const APP_NAME = "TriliumNext Notes";
module.exports = { module.exports = {
packagerConfig: { packagerConfig: {
executableName: "trilium", executableName: "trilium",
name: 'TriliumNext Notes', name: APP_NAME,
overwrite: true, overwrite: true,
asar: true, asar: true,
icon: "./images/app-icons/icon", icon: "./images/app-icons/icon",
extraResource: getExtraResourcesForPlatform(), extraResource: getExtraResourcesForPlatform(),
afterComplete: [(buildPath, electronVersion, platform, arch, callback) => { afterComplete: [(buildPath, _electronVersion, platform, _arch, callback) => {
const extraResources = getExtraResourcesForPlatform(); const extraResources = getExtraResourcesForPlatform();
for (const resource of extraResources) { for (const resource of extraResources) {
let sourcePath; let sourcePath;
if (platform === 'darwin') { if (platform === 'darwin') {
sourcePath = path.join(buildPath, 'TriliumNextNotes.app', 'Contents', 'Resources', path.basename(resource)); sourcePath = path.join(buildPath, `${APP_NAME}.app`, 'Contents', 'Resources', path.basename(resource));
} else { } else {
sourcePath = path.join(buildPath, 'resources', path.basename(resource)); sourcePath = path.join(buildPath, 'resources', path.basename(resource));
} }