From 94340ab1a1b12259e786f5df0f4fd765aaf18b2d Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 11 Aug 2024 06:57:34 +0300 Subject: [PATCH] build: Fix app name in Electron Forge hook --- forge.config.cjs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/forge.config.cjs b/forge.config.cjs index 9529b24f1..e3bed969e 100644 --- a/forge.config.cjs +++ b/forge.config.cjs @@ -1,20 +1,22 @@ const path = require('path'); const fs = require('fs-extra'); +const APP_NAME = "TriliumNext Notes"; + module.exports = { packagerConfig: { executableName: "trilium", - name: 'TriliumNext Notes', + name: APP_NAME, overwrite: true, asar: true, icon: "./images/app-icons/icon", extraResource: getExtraResourcesForPlatform(), - afterComplete: [(buildPath, electronVersion, platform, arch, callback) => { + afterComplete: [(buildPath, _electronVersion, platform, _arch, callback) => { const extraResources = getExtraResourcesForPlatform(); for (const resource of extraResources) { let sourcePath; 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 { sourcePath = path.join(buildPath, 'resources', path.basename(resource)); }