Skip to content

Commit

Permalink
uv step: checking self subcommand exits; fixes #942 (#971)
Browse files Browse the repository at this point in the history
* uv step: checking self subcommand exits; fixes #942

* uv: fixing return behavior

---------

Co-authored-by: Lucas Parzianello <[email protected]>
  • Loading branch information
lucaspar and lucaspar authored Oct 29, 2024
1 parent f181a79 commit 39f76a3
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/steps/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1032,15 +1032,20 @@ pub fn run_uv(ctx: &ExecutionContext) -> Result<()> {
let uv_exec = require("uv")?;
print_separator("uv");

ctx.run_type()
// try uv self --help first - if it succeeds, we call uv self update
let result = ctx
.run_type()
.execute(&uv_exec)
.args(["self", "update"])
.status_checked()
.ok();
.args(["self", "--help"])
.output_checked();

// ignoring self-update errors, because they are likely due to uv's
// installation being managed by another package manager, in which
// case another step will handle the update.
if result.is_ok() {
ctx.run_type()
.execute(&uv_exec)
.args(["self", "update"])
.status_checked()
.ok();
}

ctx.run_type()
.execute(&uv_exec)
Expand Down

0 comments on commit 39f76a3

Please sign in to comment.