From c00315a350355ff9dd4c7a2c65853d83b6d02a76 Mon Sep 17 00:00:00 2001 From: Gar Date: Mon, 1 May 2023 09:14:31 -0700 Subject: [PATCH] fix: check lower case extensions in windows --- lib/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 8de3388..52e9ea6 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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('') }