summaryrefslogtreecommitdiff
path: root/cli/tools/upgrade.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2024-08-21 07:25:17 -0700
committerGitHub <noreply@github.com>2024-08-21 19:55:17 +0530
commite2c50f7e8ada214f3a44a49da2faa0716d24970e (patch)
tree5c2b46e49edbee20b8d1957f68cad269277fd18f /cli/tools/upgrade.rs
parent76990df6fa85d5a251adb0eed2f0e4c37ae6e8db (diff)
fix(upgrade): better error message when check_exe fails (#25133)
Fixes https://github.com/denoland/deno/issues/24971 Fixes the panic. We can give a more personalized error by checking the macOS version but probably not worth the effort.
Diffstat (limited to 'cli/tools/upgrade.rs')
-rw-r--r--cli/tools/upgrade.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/cli/tools/upgrade.rs b/cli/tools/upgrade.rs
index db43b8be1..50d6395fc 100644
--- a/cli/tools/upgrade.rs
+++ b/cli/tools/upgrade.rs
@@ -972,8 +972,13 @@ fn check_exe(exe_path: &Path) -> Result<(), AnyError> {
.arg("-V")
.stderr(std::process::Stdio::inherit())
.output()?;
- assert!(output.status.success());
- Ok(())
+ if !output.status.success() {
+ bail!(
+ "Failed to validate Deno executable. This may be because your OS is unsupported or the executable is corrupted"
+ )
+ } else {
+ Ok(())
+ }
}
#[derive(Debug)]