Skip to content

Commit

Permalink
fix: check lower case extensions in windows (#100)
Browse files Browse the repository at this point in the history
Closes #57
  • Loading branch information
wraithgar authored May 1, 2023
1 parent ba58b51 commit c3a543e
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 c3a543e

Please sign in to comment.