mirror of
https://github.com/deployphp/action.git
synced 2025-06-28 20:24:14 +00:00
Update deps
This commit is contained in:
parent
eed58e3496
commit
363bb1be96
126 changed files with 5743 additions and 2737 deletions
52
node_modules/which/bin/node-which
generated
vendored
52
node_modules/which/bin/node-which
generated
vendored
|
@ -1,52 +0,0 @@
|
|||
#!/usr/bin/env node
|
||||
var which = require("../")
|
||||
if (process.argv.length < 3)
|
||||
usage()
|
||||
|
||||
function usage () {
|
||||
console.error('usage: which [-as] program ...')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
var all = false
|
||||
var silent = false
|
||||
var dashdash = false
|
||||
var args = process.argv.slice(2).filter(function (arg) {
|
||||
if (dashdash || !/^-/.test(arg))
|
||||
return true
|
||||
|
||||
if (arg === '--') {
|
||||
dashdash = true
|
||||
return false
|
||||
}
|
||||
|
||||
var flags = arg.substr(1).split('')
|
||||
for (var f = 0; f < flags.length; f++) {
|
||||
var flag = flags[f]
|
||||
switch (flag) {
|
||||
case 's':
|
||||
silent = true
|
||||
break
|
||||
case 'a':
|
||||
all = true
|
||||
break
|
||||
default:
|
||||
console.error('which: illegal option -- ' + flag)
|
||||
usage()
|
||||
}
|
||||
}
|
||||
return false
|
||||
})
|
||||
|
||||
process.exit(args.reduce(function (pv, current) {
|
||||
try {
|
||||
var f = which.sync(current, { all: all })
|
||||
if (all)
|
||||
f = f.join('\n')
|
||||
if (!silent)
|
||||
console.log(f)
|
||||
return pv;
|
||||
} catch (e) {
|
||||
return 1;
|
||||
}
|
||||
}, 0))
|
52
node_modules/which/bin/which.js
generated
vendored
Executable file
52
node_modules/which/bin/which.js
generated
vendored
Executable file
|
@ -0,0 +1,52 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const which = require('../lib')
|
||||
const argv = process.argv.slice(2)
|
||||
|
||||
const usage = (err) => {
|
||||
if (err) {
|
||||
console.error(`which: ${err}`)
|
||||
}
|
||||
console.error('usage: which [-as] program ...')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
if (!argv.length) {
|
||||
return usage()
|
||||
}
|
||||
|
||||
let dashdash = false
|
||||
const [commands, flags] = argv.reduce((acc, arg) => {
|
||||
if (dashdash || arg === '--') {
|
||||
dashdash = true
|
||||
return acc
|
||||
}
|
||||
|
||||
if (!/^-/.test(arg)) {
|
||||
acc[0].push(arg)
|
||||
return acc
|
||||
}
|
||||
|
||||
for (const flag of arg.slice(1).split('')) {
|
||||
if (flag === 's') {
|
||||
acc[1].silent = true
|
||||
} else if (flag === 'a') {
|
||||
acc[1].all = true
|
||||
} else {
|
||||
usage(`illegal option -- ${flag}`)
|
||||
}
|
||||
}
|
||||
|
||||
return acc
|
||||
}, [[], {}])
|
||||
|
||||
for (const command of commands) {
|
||||
try {
|
||||
const res = which.sync(command, { all: flags.all })
|
||||
if (!flags.silent) {
|
||||
console.log([].concat(res).join('\n'))
|
||||
}
|
||||
} catch (err) {
|
||||
process.exitCode = 1
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue