mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
refactor(electron-forge/deb): make desktop.ejs easier to read
in theory we could use variables in ejs, but unfortunately electron uses lodash template to create the file, which itself DOES NOT like any let/const/var assignments – wasted a bit of time finding this out, before coming up with this solution
This commit is contained in:
parent
a2f1d71754
commit
61e56023d4
@ -1,12 +1,17 @@
|
||||
[Desktop Entry]
|
||||
<% if (productName) { %>Name=<%= productName %>
|
||||
<% } %><% if (description) { %>Comment=<%= description %>
|
||||
<% } %><% if (genericName) { %>GenericName=<%= genericName %>
|
||||
<% } %><% if (name) { %>Exec=<%= name %> %U
|
||||
Icon=<%= name %>
|
||||
<% } %>Type=Application
|
||||
StartupNotify=true
|
||||
<% if (productName) { %>StartupWMClass=<%= productName %>
|
||||
<% } if (categories && categories.length) { %>Categories=<%= categories.join(';') %>;
|
||||
<% } %><% if (mimeType && mimeType.length) { %>MimeType=<%= mimeType.join(';') %>;
|
||||
<% } %>
|
||||
<%=
|
||||
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")%>
|
Loading…
x
Reference in New Issue
Block a user