Skip to content

Commit d8636a4

Browse files
authored
Prefer the binary's version when checking if it's up to date (#13840)
Fixes #13741
1 parent a748336 commit d8636a4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

crates/uv/src/commands/self_update.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ pub(crate) async fn self_update(
6363
return Ok(ExitStatus::Error);
6464
};
6565

66+
// If we know what our version is, ignore whatever the receipt thinks it is!
67+
// This makes us behave better if someone manually installs a random version of uv
68+
// in a way that doesn't update the receipt.
69+
if let Ok(version) = env!("CARGO_PKG_VERSION").parse() {
70+
// This is best-effort, it's fine if it fails (also it can't actually fail)
71+
let _ = updater.set_current_version(version);
72+
}
73+
6674
// Ensure the receipt is for the current binary. If it's not, then the user likely has multiple
6775
// uv binaries installed, and the current binary was _not_ installed via the standalone
6876
// installation scripts.

0 commit comments

Comments
 (0)