Skip to content

Commit

Permalink
Don't rely on slash
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Dec 26, 2024
1 parent eeeaea1 commit ba57811
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions crates/uv-tool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down

0 comments on commit ba57811

Please sign in to comment.