mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 11:26:15 +01:00
fix(nx/forge): path to electron-forge binaries
This commit is contained in:
17
apps/desktop/electron-forge/desktop.ejs
Normal file
17
apps/desktop/electron-forge/desktop.ejs
Normal file
@@ -0,0 +1,17 @@
|
||||
[Desktop Entry]
|
||||
<%=
|
||||
Object.entries({
|
||||
"Name": productName,
|
||||
"Comment": description,
|
||||
"GenericName": genericName,
|
||||
"Exec": name ? `${name} %U` : undefined,
|
||||
"Icon": name,
|
||||
"Type": "Application",
|
||||
"StartupNotify": "true",
|
||||
"StartupWMClass": productName,
|
||||
"Categories": categories?.length ? `${categories.join(";")};` : undefined,
|
||||
"MimeType": mimeType?.length ? `${mimeType.join(";")};` : undefined
|
||||
})
|
||||
.map(line => line[1] ? line.join("=") : undefined)
|
||||
.filter(line => !!line)
|
||||
.join("\n")%>
|
||||
@@ -5,7 +5,6 @@ const ELECTRON_FORGE_DIR = __dirname;
|
||||
|
||||
const EXECUTABLE_NAME = "trilium"; // keep in sync with server's package.json -> packagerConfig.executableName
|
||||
const PRODUCT_NAME = "TriliumNext Notes";
|
||||
const BIN_PATH = path.normalize("./scripts/electron-forge");
|
||||
const APP_ICON_PATH = path.join(ELECTRON_FORGE_DIR, "app-icon");
|
||||
|
||||
const extraResourcesForPlatform = getExtraResourcesForPlatform();
|
||||
@@ -13,11 +12,11 @@ const baseLinuxMakerConfigOptions = {
|
||||
name: EXECUTABLE_NAME,
|
||||
productName: PRODUCT_NAME,
|
||||
icon: path.join(APP_ICON_PATH, "png/128x128.png"),
|
||||
desktopTemplate: path.resolve(path.join(BIN_PATH, "desktop.ejs")),
|
||||
desktopTemplate: path.resolve(path.join(ELECTRON_FORGE_DIR, "desktop.ejs")),
|
||||
categories: ["Office", "Utility"]
|
||||
};
|
||||
const windowsSignConfiguration = process.env.WINDOWS_SIGN_EXECUTABLE ? {
|
||||
hookModulePath: path.join(BIN_PATH, "sign-windows.cjs")
|
||||
hookModulePath: path.join(ELECTRON_FORGE_DIR, "sign-windows.cjs")
|
||||
} : undefined;
|
||||
|
||||
module.exports = {
|
||||
|
||||
14
apps/desktop/electron-forge/sign-windows.cjs
Normal file
14
apps/desktop/electron-forge/sign-windows.cjs
Normal file
@@ -0,0 +1,14 @@
|
||||
const child_process = require("child_process");
|
||||
|
||||
module.exports = function (filePath) {
|
||||
const { WINDOWS_SIGN_EXECUTABLE } = process.env;
|
||||
|
||||
if (!WINDOWS_SIGN_EXECUTABLE) {
|
||||
console.warn("[Sign] Skip signing due to missing environment variable.");
|
||||
return;
|
||||
}
|
||||
|
||||
const command = `${WINDOWS_SIGN_EXECUTABLE} --executable "${filePath}"`;
|
||||
console.log(`[Sign] ${command}`);
|
||||
child_process.execSync(command);
|
||||
}
|
||||
Reference in New Issue
Block a user