Notes/bin/electron-forge/desktop.ejs
Panagiotis Papadopoulos 61e56023d4 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
2025-02-02 22:25:56 +01:00

17 lines
518 B
Plaintext

[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")%>