A command-line journaling application
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

support Windows

Fixes https://todo.sr.ht/~bmp/hayom/1

+10 -3
+10 -3
config.ts
··· 12 12 13 13 function homeDir(): string { 14 14 if (Deno.build.os === "windows") { 15 - throw new Error("Not supported yet"); 15 + const home = Deno.env.get("USERPROFILE"); 16 + if (home == null) throw new Error("USERPROFILE missing"); 17 + return home; 16 18 } else { 17 19 const home = Deno.env.get("HOME"); 18 20 if (home == null) throw new Error("$HOME missing"); ··· 22 24 23 25 function configDir(): string { 24 26 if (Deno.build.os === "windows") { 25 - throw new Error("Not supported yet"); 27 + const profile = Deno.env.get("APPDATA"); 28 + if (profile == null) throw new Error("APPDATA missing"); 29 + return profile; 26 30 } else { 27 31 let configRoot = Deno.env.get("XDG_CONFIG_HOME"); 28 32 if (configRoot == null) { ··· 37 41 } 38 42 39 43 function defaultJournalPath(): string { 40 - return path.join(homeDir(), ".journal"); 44 + return path.join( 45 + homeDir(), 46 + Deno.build.os === "windows" ? "hayom.txt" : ".hayom", 47 + ); 41 48 } 42 49 43 50 function defaultEditor(): string {