Skip to content

Commit

Permalink
fix: check lower case extensions in windows
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed May 1, 2023
1 parent ba58b51 commit c00315a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@ const getPathInfo = (cmd, {
]

if (isWindows) {
const pathExtExe = optPathExt || ['.EXE', '.CMD', '.BAT', '.COM'].join(optDelimiter)
const pathExt = pathExtExe.split(optDelimiter)
const pathExtExe = optPathExt ||
['.EXE', '.CMD', '.BAT', '.COM'].join(optDelimiter)
const pathExt = pathExtExe.split(optDelimiter).reduce((acc, item) => {
acc.push(item)
acc.push(item.toLowerCase())
return acc
}, [])
if (cmd.includes('.') && pathExt[0] !== '') {
pathExt.unshift('')
}
Expand Down

0 comments on commit c00315a

Please sign in to comment.