aboutsummaryrefslogtreecommitdiff
path: root/node_modules/isexe/windows.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/isexe/windows.js')
-rw-r--r--node_modules/isexe/windows.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/node_modules/isexe/windows.js b/node_modules/isexe/windows.js
index aba8561f3..34996734d 100644
--- a/node_modules/isexe/windows.js
+++ b/node_modules/isexe/windows.js
@@ -24,13 +24,19 @@ function checkPathExt (path, options) {
return false
}
+function checkStat (stat, path, options) {
+ if (!stat.isSymbolicLink() && !stat.isFile()) {
+ return false
+ }
+ return checkPathExt(path, options)
+}
+
function isexe (path, options, cb) {
- fs.stat(path, function (er, st) {
- cb(er, er ? false : checkPathExt(path, options))
+ fs.stat(path, function (er, stat) {
+ cb(er, er ? false : checkStat(stat, path, options))
})
}
function sync (path, options) {
- fs.statSync(path)
- return checkPathExt(path, options)
+ return checkStat(fs.statSync(path), path, options)
}