From 90c5aadbca8b47fc43bd3ece80e007b1b546c402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E6=9D=89?= Date: Sun, 8 Dec 2019 21:59:27 +0800 Subject: fix(installer): installs to the wrong directory on Windows (#3462) Close: #3443 --- std/installer/mod.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'std/installer/mod.ts') diff --git a/std/installer/mod.ts b/std/installer/mod.ts index 17752517c..7751bc12e 100644 --- a/std/installer/mod.ts +++ b/std/installer/mod.ts @@ -78,16 +78,16 @@ function getFlagFromPermission(perm: Permission): string { function getInstallerDir(): string { // In Windows's Powershell $HOME environmental variable maybe null - // if so use $HOMEPATH instead. - const { HOME, HOMEPATH } = env(); + // if so use $USERPROFILE instead. + const { HOME, USERPROFILE } = env(); - const HOME_PATH = HOME || HOMEPATH; + const HOME_PATH = HOME || USERPROFILE; if (!HOME_PATH) { throw new Error("$HOME is not defined."); } - return path.join(HOME_PATH, ".deno", "bin"); + return path.resolve(HOME_PATH, ".deno", "bin"); } async function readCharacter(): Promise { -- cgit v1.2.3