Skip to content

Commit 01f6e04

Browse files
Merge pull request #941 from charlespierce/case_insensitive_exe
[Tiny] Make tool name case-insensitive on Windows
2 parents 261fe58 + a5d9a16 commit 01f6e04

File tree

1 file changed

+3
-2
lines changed
  • crates/volta-core/src/run

1 file changed

+3
-2
lines changed

crates/volta-core/src/run/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,11 @@ fn tool_name_from_file_name(file_name: &OsStr) -> OsString {
104104

105105
#[cfg(windows)]
106106
fn tool_name_from_file_name(file_name: &OsStr) -> OsString {
107-
// On Windows PowerShell, the file name includes the .exe suffix
107+
// On Windows PowerShell, the file name includes the .exe suffix,
108+
// and the Windows file system is case-insensitive
108109
// We need to remove that to get the raw tool name
109110
match file_name.to_str() {
110-
Some(file) => OsString::from(file.trim_end_matches(".exe")),
111+
Some(file) => OsString::from(file.to_ascii_lowercase().trim_end_matches(".exe")),
111112
None => OsString::from(file_name),
112113
}
113114
}

0 commit comments

Comments
 (0)