Skip to content

Commit c3a543e

Browse files
authored
fix: check lower case extensions in windows (#100)
Closes #57
1 parent ba58b51 commit c3a543e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@ const getPathInfo = (cmd, {
2929
]
3030

3131
if (isWindows) {
32-
const pathExtExe = optPathExt || ['.EXE', '.CMD', '.BAT', '.COM'].join(optDelimiter)
33-
const pathExt = pathExtExe.split(optDelimiter)
32+
const pathExtExe = optPathExt ||
33+
['.EXE', '.CMD', '.BAT', '.COM'].join(optDelimiter)
34+
const pathExt = pathExtExe.split(optDelimiter).reduce((acc, item) => {
35+
acc.push(item)
36+
acc.push(item.toLowerCase())
37+
return acc
38+
}, [])
3439
if (cmd.includes('.') && pathExt[0] !== '') {
3540
pathExt.unshift('')
3641
}

0 commit comments

Comments
 (0)