Skip to content

Commit

Permalink
fix: trim final exe suffix for stable sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
lucab committed Sep 27, 2024
1 parent d54583d commit 3838164
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions crates/uv/src/commands/tool/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,19 +196,17 @@ pub(crate) fn install_executables(
)
}

let mut names = BTreeSet::new();
for (name, source_path, target_path) in &target_entry_points {
debug!("Installing executable: `{name}`");
#[cfg(unix)]
replace_symlink(source_path, target_path).context("Failed to install executable")?;
#[cfg(windows)]
fs_err::copy(source_path, target_path).context("Failed to install entrypoint")?;
names.insert(name.trim_end_matches(".exe"));
}

let s = if target_entry_points.len() == 1 {
""
} else {
"s"
};
let s = if names.len() == 1 { "" } else { "s" };
let from_pkg = if tool_name == name {
String::new()
} else {
Expand All @@ -217,11 +215,8 @@ pub(crate) fn install_executables(
writeln!(
printer.stderr(),
"Installed {} executable{s}{from_pkg}: {}",
target_entry_points.len(),
target_entry_points
.iter()
.map(|(name, _, _)| name.bold())
.join(", ")
names.len(),
names.iter().map(|name| name.bold()).join(", ")
)?;

debug!("Adding receipt for tool `{tool_name}`");
Expand Down

0 comments on commit 3838164

Please sign in to comment.