summaryrefslogtreecommitdiff
path: root/std/installer/mod.ts
diff options
context:
space:
mode:
author木杉 <zhmushan@qq.com>2019-12-08 21:59:27 +0800
committerBert Belder <bertbelder@gmail.com>2019-12-08 14:59:27 +0100
commit90c5aadbca8b47fc43bd3ece80e007b1b546c402 (patch)
tree6ecb65a3e213d1d7e08a264214b9b14e39a3fafe /std/installer/mod.ts
parent50b6907bc332315eeb13c05bf687b990bc8dd936 (diff)
fix(installer): installs to the wrong directory on Windows (#3462)
Close: #3443
Diffstat (limited to 'std/installer/mod.ts')
-rw-r--r--std/installer/mod.ts8
1 files changed, 4 insertions, 4 deletions
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<string> {