summaryrefslogtreecommitdiff
path: root/cli/tools
diff options
context:
space:
mode:
authorKamil Ogórek <kamil.ogorek@gmail.com>2023-02-16 20:14:57 +0100
committerGitHub <noreply@github.com>2023-02-16 21:14:57 +0200
commit6e1b737400742aa2332a30fb937df5fc5af878d7 (patch)
tree0e98e2fe60ee9d2da448ceb7a3bf327a11f71969 /cli/tools
parent0aeb8bc7591ec32e199b98f4532d6a962c6da6cb (diff)
ref(cli): Add better error message when powershell is missing during upgrade (#17759)
Closes https://github.com/denoland/deno/issues/17756
Diffstat (limited to 'cli/tools')
-rw-r--r--cli/tools/upgrade.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/cli/tools/upgrade.rs b/cli/tools/upgrade.rs
index f6533f690..b56be5c57 100644
--- a/cli/tools/upgrade.rs
+++ b/cli/tools/upgrade.rs
@@ -511,7 +511,17 @@ pub fn unpack_into_dir(
.arg(format!("'{}'", &archive_path.to_str().unwrap()))
.arg("-DestinationPath")
.arg(format!("'{}'", &temp_dir_path.to_str().unwrap()))
- .spawn()?
+ .spawn()
+ .map_err(|err| {
+ if err.kind() == std::io::ErrorKind::NotFound {
+ std::io::Error::new(
+ std::io::ErrorKind::NotFound,
+ "`powershell.exe` was not found in your PATH",
+ )
+ } else {
+ err
+ }
+ })?
.wait()?
}
"zip" => {
@@ -524,7 +534,7 @@ pub fn unpack_into_dir(
if err.kind() == std::io::ErrorKind::NotFound {
std::io::Error::new(
std::io::ErrorKind::NotFound,
- "`unzip` was not found on your PATH, please install `unzip`",
+ "`unzip` was not found in your PATH, please install `unzip`",
)
} else {
err