mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 19:36:12 +01:00
fix(monorepo/electron): copy-dist failing
This commit is contained in:
@@ -22,8 +22,8 @@ try {
|
||||
*/
|
||||
const assetsToCopy = new Set([
|
||||
"./forge.config.cjs",
|
||||
"./bin/electron-forge/desktop.ejs",
|
||||
"./bin/electron-forge/sign-windows.cjs",
|
||||
"./scripts/electron-forge/desktop.ejs",
|
||||
"./scripts/electron-forge/sign-windows.cjs",
|
||||
]);
|
||||
|
||||
for (const asset of assetsToCopy) {
|
||||
@@ -34,7 +34,7 @@ try {
|
||||
/**
|
||||
* Directories to be copied relative to the project root into <resource_dir>/src/public/app-dist.
|
||||
*/
|
||||
const publicDirsToCopy = ["./src/public/app/doc_notes"];
|
||||
const publicDirsToCopy = ["../server/src/public/app/doc_notes"];
|
||||
const PUBLIC_DIR = path.join(DEST_DIR, "src", "public", "app-dist");
|
||||
for (const dir of publicDirsToCopy) {
|
||||
fs.copySync(dir, path.join(PUBLIC_DIR, path.basename(dir)));
|
||||
|
||||
17
apps/electron/scripts/electron-forge/desktop.ejs
Normal file
17
apps/electron/scripts/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")%>
|
||||
14
apps/electron/scripts/electron-forge/sign-windows.cjs
Normal file
14
apps/electron/scripts/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