]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/windows.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / which / node_modules / isexe / windows.js
diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/windows.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/windows.js
new file mode 100644 (file)
index 0000000..aba8561
--- /dev/null
@@ -0,0 +1,36 @@
+module.exports = isexe
+isexe.sync = sync
+
+var fs = require('fs')
+
+function checkPathExt (path, options) {
+  var pathext = options.pathExt !== undefined ?
+    options.pathExt : process.env.PATHEXT
+
+  if (!pathext) {
+    return true
+  }
+
+  pathext = pathext.split(';')
+  if (pathext.indexOf('') !== -1) {
+    return true
+  }
+  for (var i = 0; i < pathext.length; i++) {
+    var p = pathext[i].toLowerCase()
+    if (p && path.substr(-p.length).toLowerCase() === p) {
+      return true
+    }
+  }
+  return false
+}
+
+function isexe (path, options, cb) {
+  fs.stat(path, function (er, st) {
+    cb(er, er ? false : checkPathExt(path, options))
+  })
+}
+
+function sync (path, options) {
+  fs.statSync(path)
+  return checkPathExt(path, options)
+}