summaryrefslogtreecommitdiff
path: root/cli/installer.rs
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2020-10-30 02:19:03 +0000
committerGitHub <noreply@github.com>2020-10-30 03:19:03 +0100
commit6be6c517d0691bf1d14eef67668e575c84cdfdf4 (patch)
treefd6b37f2807f78325a08fff5e34166d6eec84ca7 /cli/installer.rs
parent1854c6f73be9d4439807911ce9cba1125af93dd4 (diff)
fix(cli/fmt): Strip "\\?\" prefix when displaying Windows paths (#8135)
Diffstat (limited to 'cli/installer.rs')
-rw-r--r--cli/installer.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/cli/installer.rs b/cli/installer.rs
index 969572e1b..4a177b3ea 100644
--- a/cli/installer.rs
+++ b/cli/installer.rs
@@ -1,6 +1,7 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
use crate::flags::Flags;
+use crate::fs::canonicalize_path;
use deno_core::error::generic_error;
use deno_core::error::AnyError;
use deno_core::url::Url;
@@ -84,7 +85,7 @@ deno {} "$@"
fn get_installer_root() -> Result<PathBuf, io::Error> {
if let Ok(env_dir) = env::var("DENO_INSTALL_ROOT") {
if !env_dir.is_empty() {
- return PathBuf::from(env_dir).canonicalize();
+ return canonicalize_path(&PathBuf::from(env_dir));
}
}
// Note: on Windows, the $HOME environment variable may be set by users or by
@@ -127,7 +128,7 @@ pub fn install(
force: bool,
) -> Result<(), AnyError> {
let root = if let Some(root) = root {
- root.canonicalize()?
+ canonicalize_path(&root)?
} else {
get_installer_root()?
};