mirror of
https://github.com/actions/setup-java.git
synced 2025-04-20 18:06:45 +00:00
Fix.
This commit is contained in:
parent
596a6da241
commit
c1a589c5b6
7078 changed files with 1882834 additions and 319 deletions
42
node_modules/isexe/windows.js
generated
vendored
Normal file
42
node_modules/isexe/windows.js
generated
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
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 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, stat) {
|
||||
cb(er, er ? false : checkStat(stat, path, options))
|
||||
})
|
||||
}
|
||||
|
||||
function sync (path, options) {
|
||||
return checkStat(fs.statSync(path), path, options)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue