mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 13:39:01 +01:00 
			
		
		
		
	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
		
			
				
	
	
		
			17 lines
		
	
	
		
			518 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			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")%> |