From 8f7e49ffcce7b7250d226339a4269a44a6a3e74d Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Tue, 9 Sep 2025 22:45:48 +0800 Subject: [PATCH] feat: updates deno-commons-mod.ts --- libraries/deno-commons-mod.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libraries/deno-commons-mod.ts b/libraries/deno-commons-mod.ts index 186a28c..6b38edb 100644 --- a/libraries/deno-commons-mod.ts +++ b/libraries/deno-commons-mod.ts @@ -238,7 +238,16 @@ export const log = new Logger(); export function getHomeDir(): string | null { if (Deno.build.os === "windows") { - return Deno.env.get("USERPROFILE") || Deno.env.get("HOMEDRIVE") + Deno.env.get("HOMEPATH") || null; + const userProfile = Deno.env.get("USERPROFILE"); + if (userProfile) { + return userProfile; + } + const homeDrive = Deno.env.get("HOMEDRIVE"); + const homePath = Deno.env.get("HOMEPATH"); + if (homeDrive && homePath) { + return homeDrive + homePath; + } + return null; } return Deno.env.get("HOME") || null; }