mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-26 17:41:34 +08:00 
			
		
		
		
	 61e56023d4
			
		
	
	
		61e56023d4
		
	
	
	
	
		
			
			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")%> |