1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

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.
This commit is contained in:
Divy Srivastava 2024-08-21 07:25:17 -07:00 committed by GitHub
parent 76990df6fa
commit e2c50f7e8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -972,8 +972,13 @@ fn check_exe(exe_path: &Path) -> Result<(), AnyError> {
.arg("-V") .arg("-V")
.stderr(std::process::Stdio::inherit()) .stderr(std::process::Stdio::inherit())
.output()?; .output()?;
assert!(output.status.success()); if !output.status.success() {
Ok(()) bail!(
"Failed to validate Deno executable. This may be because your OS is unsupported or the executable is corrupted"
)
} else {
Ok(())
}
} }
#[derive(Debug)] #[derive(Debug)]