From ba578117bb136d817c83d62db9e953a7da352c90 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 26 Dec 2024 09:21:31 -0500 Subject: [PATCH] Don't rely on slash --- crates/uv-tool/src/lib.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/crates/uv-tool/src/lib.rs b/crates/uv-tool/src/lib.rs index a2e62b07de55..081be9a72511 100644 --- a/crates/uv-tool/src/lib.rs +++ b/crates/uv-tool/src/lib.rs @@ -418,12 +418,11 @@ pub fn entrypoint_paths( }; let absolute_path = layout.scheme.scripts.join(path_in_scripts); - let script_name = entry - .path - .rsplit('/') - .next() - .unwrap_or(&entry.path) - .to_string(); + let script_name = relative_path + .file_name() + .and_then(|filename| filename.to_str()) + .map(ToString::to_string) + .unwrap_or(entry.path); entrypoints.push((script_name, absolute_path)); }