refactor(forge.config): call getExtraResourcesForPlatform once only

This commit is contained in:
Panagiotis Papadopoulos 2025-02-05 09:33:33 +01:00
parent e0862ce8f3
commit 2b83470de6

View File

@ -3,6 +3,7 @@ const fs = require("fs-extra");
const APP_NAME = "TriliumNext Notes"; const APP_NAME = "TriliumNext Notes";
const extraResourcesForPlatform = getExtraResourcesForPlatform();
const baseLinuxMakerConfigOptions = { const baseLinuxMakerConfigOptions = {
icon: "./images/app-icons/png/128x128.png", icon: "./images/app-icons/png/128x128.png",
desktopTemplate: path.resolve("./bin/electron-forge/desktop.ejs"), desktopTemplate: path.resolve("./bin/electron-forge/desktop.ejs"),
@ -17,7 +18,7 @@ module.exports = {
icon: "./images/app-icons/icon", icon: "./images/app-icons/icon",
extraResource: [ extraResource: [
// Moved to root // Moved to root
...getExtraResourcesForPlatform(), ...extraResourcesForPlatform,
// Moved to resources (TriliumNext Notes.app/Contents/Resources on macOS) // Moved to resources (TriliumNext Notes.app/Contents/Resources on macOS)
"translations/", "translations/",
@ -25,8 +26,7 @@ module.exports = {
], ],
afterComplete: [ afterComplete: [
(buildPath, _electronVersion, platform, _arch, callback) => { (buildPath, _electronVersion, platform, _arch, callback) => {
const extraResources = getExtraResourcesForPlatform(); for (const resource of extraResourcesForPlatform) {
for (const resource of extraResources) {
const baseName = path.basename(resource); const baseName = path.basename(resource);
// prettier-ignore // prettier-ignore