diff --git a/.gitignore b/.gitignore index 54fbf6c..002785c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .aider* bin/** .DS_Store +unibear.md diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 013326a..d779a4f 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -57,7 +57,12 @@ export const fileExists = async ( }; export function getAppConfigDir(): string { - const xdgConfigHome = Deno.env.get("XDG_CONFIG_HOME") ?? + if (Deno.build.os === "windows") { + const appData = Deno.env.get("APPDATA") ?? + join(Deno.env.get("HOME") || "", "AppData", "Roaming"); + return join(appData, "unibear"); + } + const xdg = Deno.env.get("XDG_CONFIG_HOME") ?? join(Deno.env.get("HOME") || "", ".config"); - return join(xdgConfigHome, "unibear"); + return join(xdg, "unibear"); }