Skip to content

Commit 17cff21

Browse files
committed
Improve uvx error message when uv is missing
1 parent 0242f43 commit 17cff21

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

crates/uv/src/bin/uvx.rs

+8
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ fn run() -> std::io::Result<ExitStatus> {
3838
.chain(std::env::args_os().skip(1))
3939
.collect::<Vec<_>>();
4040

41+
// If we are sure the uv binary does not exist, display a clearer error message
42+
if matches!(uv.try_exists(), Ok(false)) {
43+
return Err(std::io::Error::new(
44+
std::io::ErrorKind::NotFound,
45+
format!("Could not find the `uv` binary at: {}", uv.display()),
46+
));
47+
}
48+
4149
let mut cmd = Command::new(uv);
4250
cmd.args(&args);
4351
match exec_spawn(&mut cmd)? {}

0 commit comments

Comments
 (0)