Skip to content

Commit

Permalink
fix: check if files are same in self-update (#2132)
Browse files Browse the repository at this point in the history
  • Loading branch information
apoorvkh authored Sep 30, 2024
1 parent 60f899a commit 1040b1f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ reqwest-middleware = "0.3.0"
reqwest-retry = "0.5.0"
rlimit = "0.10.1"
rstest = "0.19.0"
same-file = "1.0.6"
self-replace = "1.3.7"
serde = "1.0.198"
serde-untagged = "0.1.5"
Expand Down Expand Up @@ -245,6 +246,7 @@ reqwest = { workspace = true, features = [
] }
reqwest-middleware = { workspace = true }
rlimit = { workspace = true }
same-file = { workspace = true }
self-replace = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
Expand Down
10 changes: 5 additions & 5 deletions src/cli/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ fn default_pixi_binary_path() -> std::path::PathBuf {

// check current binary is in the default pixi location
fn is_pixi_binary_default_location() -> bool {
let default_binary_path = default_pixi_binary_path();

std::env::current_exe()
.expect("Failed to retrieve the current pixi binary path")
.starts_with(default_binary_path)
same_file::is_same_file(
std::env::current_exe().expect("Failed to retrieve the current pixi binary path"),
default_pixi_binary_path(),
)
.unwrap_or(false)
}

0 comments on commit 1040b1f

Please sign in to comment.