Show file extensions on available commands when not `.exe` (#9099)

Closes https://github.com/astral-sh/uv/issues/8770
This commit is contained in:
Zanie Blue 2024-11-14 10:21:19 -06:00 committed by GitHub
parent 57ff5330fc
commit 50cfbd904c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -897,7 +897,11 @@ pub(crate) async fn run(
.map(|entry| entry.path())
.filter(|path| is_executable(path))
.map(|path| {
if cfg!(windows) {
if cfg!(windows)
&& path
.extension()
.is_some_and(|exe| exe == std::env::consts::EXE_EXTENSION)
{
// Remove the extensions.
path.with_extension("")
} else {

View File

@ -248,7 +248,7 @@ fn run_no_args() -> Result<()> {
The following commands are available in the environment:
- pydoc
- pydoc.bat
- python
- pythonw