aboutsummaryrefslogtreecommitdiff
path: root/node_modules/which
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-10-10 03:43:44 +0200
committerFlorian Dold <florian.dold@gmail.com>2016-10-10 03:43:44 +0200
commitabd94a7f5a50f43c797a11b53549ae48fff667c3 (patch)
treeab8ed457f65cdd72e13e0571d2975729428f1551 /node_modules/which
parenta0247c6a3fd6a09a41a7e35a3441324c4dcb58be (diff)
downloadwallet-core-abd94a7f5a50f43c797a11b53549ae48fff667c3.tar.xz
add node_modules to address #4364
Diffstat (limited to 'node_modules/which')
-rw-r--r--node_modules/which/CHANGELOG.md126
-rw-r--r--node_modules/which/LICENSE15
-rw-r--r--node_modules/which/README.md48
-rwxr-xr-xnode_modules/which/bin/which52
-rw-r--r--node_modules/which/package.json100
-rw-r--r--node_modules/which/which.js133
6 files changed, 474 insertions, 0 deletions
diff --git a/node_modules/which/CHANGELOG.md b/node_modules/which/CHANGELOG.md
new file mode 100644
index 000000000..f2c6e4fd3
--- /dev/null
+++ b/node_modules/which/CHANGELOG.md
@@ -0,0 +1,126 @@
+# Changes
+
+
+## v1.2.11
+
+* Prevent changelog script from being included in package
+
+## v1.2.10
+
+* Use env.PATH only, not env.Path
+
+## v1.2.9
+
+* fix for paths starting with ../
+* Remove unused `is-absolute` module
+
+## v1.2.8
+
+* bullet items in changelog that contain (but don't start with) #
+
+## v1.2.7
+
+* strip 'update changelog' changelog entries out of changelog
+
+## v1.2.6
+
+* make the changelog bulleted
+
+## v1.2.5
+
+* make a changelog, and keep it up to date
+* don't include tests in package
+* Properly handle relative-path executables
+* appveyor
+* Attach error code to Not Found error
+* Make tests pass on Windows
+
+## v1.2.4
+
+* Fix typo
+
+## v1.2.3
+
+* update isexe, fix regression in pathExt handling
+
+## v1.2.2
+
+* update deps, use isexe module, test windows
+
+## v1.2.1
+
+* Sometimes windows PATH entries are quoted
+* Fixed a bug in the check for group and user mode bits. This bug was introduced during refactoring for supporting strict mode.
+* doc cli
+
+## v1.2.0
+
+* Add support for opt.all and -as cli flags
+* test the bin
+* update travis
+* Allow checking for multiple programs in bin/which
+* tap 2
+
+## v1.1.2
+
+* travis
+* Refactored and fixed undefined error on Windows
+* Support strict mode
+
+## v1.1.1
+
+* test +g exes against secondary groups, if available
+* Use windows exe semantics on cygwin & msys
+* cwd should be first in path on win32, not last
+* Handle lower-case 'env.Path' on Windows
+* Update docs
+* use single-quotes
+
+## v1.1.0
+
+* Add tests, depend on is-absolute
+
+## v1.0.9
+
+* which.js: root is allowed to execute files owned by anyone
+
+## v1.0.8
+
+* don't use graceful-fs
+
+## v1.0.7
+
+* add license to package.json
+
+## v1.0.6
+
+* isc license
+
+## 1.0.5
+
+* Awful typo
+
+## 1.0.4
+
+* Test for path absoluteness properly
+* win: Allow '' as a pathext if cmd has a . in it
+
+## 1.0.3
+
+* Remove references to execPath
+* Make `which.sync()` work on Windows by honoring the PATHEXT variable.
+* Make `isExe()` always return true on Windows.
+* MIT
+
+## 1.0.2
+
+* Only files can be exes
+
+## 1.0.1
+
+* Respect the PATHEXT env for win32 support
+* should 0755 the bin
+* binary
+* guts
+* package
+* 1st
diff --git a/node_modules/which/LICENSE b/node_modules/which/LICENSE
new file mode 100644
index 000000000..19129e315
--- /dev/null
+++ b/node_modules/which/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/which/README.md b/node_modules/which/README.md
new file mode 100644
index 000000000..7f679d595
--- /dev/null
+++ b/node_modules/which/README.md
@@ -0,0 +1,48 @@
+# which
+
+Like the unix `which` utility.
+
+Finds the first instance of a specified executable in the PATH
+environment variable. Does not cache the results, so `hash -r` is not
+needed when the PATH changes.
+
+## USAGE
+
+```javascript
+var which = require('which')
+
+// async usage
+which('node', function (er, resolvedPath) {
+ // er is returned if no "node" is found on the PATH
+ // if it is found, then the absolute path to the exec is returned
+})
+
+// sync usage
+// throws if not found
+var resolved = which.sync('node')
+
+// Pass options to override the PATH and PATHEXT environment vars.
+which('node', { path: someOtherPath }, function (er, resolved) {
+ if (er)
+ throw er
+ console.log('found at %j', resolved)
+})
+```
+
+## CLI USAGE
+
+Same as the BSD `which(1)` binary.
+
+```
+usage: which [-as] program ...
+```
+
+## OPTIONS
+
+You may pass an options object as the second argument.
+
+- `path`: Use instead of the `PATH` environment variable.
+- `pathExt`: Use instead of the `PATHEXT` environment variable.
+- `all`: Return all matches, instead of just the first one. Note that
+ this means the function returns an array of strings instead of a
+ single string.
diff --git a/node_modules/which/bin/which b/node_modules/which/bin/which
new file mode 100755
index 000000000..7cee3729e
--- /dev/null
+++ b/node_modules/which/bin/which
@@ -0,0 +1,52 @@
+#!/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))
diff --git a/node_modules/which/package.json b/node_modules/which/package.json
new file mode 100644
index 000000000..4d46b8ccf
--- /dev/null
+++ b/node_modules/which/package.json
@@ -0,0 +1,100 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "which@^1.2.10",
+ "scope": null,
+ "escapedName": "which",
+ "name": "which",
+ "rawSpec": "^1.2.10",
+ "spec": ">=1.2.10 <2.0.0",
+ "type": "range"
+ },
+ "/home/dold/repos/taler/wallet-webex/node_modules/global-prefix"
+ ]
+ ],
+ "_from": "which@>=1.2.10 <2.0.0",
+ "_id": "which@1.2.11",
+ "_inCache": true,
+ "_location": "/which",
+ "_nodeVersion": "6.5.0",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/which-1.2.11.tgz_1473093398489_0.1032072464004159"
+ },
+ "_npmUser": {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ },
+ "_npmVersion": "3.10.7",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "which@^1.2.10",
+ "scope": null,
+ "escapedName": "which",
+ "name": "which",
+ "rawSpec": "^1.2.10",
+ "spec": ">=1.2.10 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/global-prefix"
+ ],
+ "_resolved": "https://registry.npmjs.org/which/-/which-1.2.11.tgz",
+ "_shasum": "c8b2eeea6b8c1659fa7c1dd4fdaabe9533dc5e8b",
+ "_shrinkwrap": null,
+ "_spec": "which@^1.2.10",
+ "_where": "/home/dold/repos/taler/wallet-webex/node_modules/global-prefix",
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me",
+ "url": "http://blog.izs.me"
+ },
+ "bin": {
+ "which": "./bin/which"
+ },
+ "bugs": {
+ "url": "https://github.com/isaacs/node-which/issues"
+ },
+ "dependencies": {
+ "isexe": "^1.1.1"
+ },
+ "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.",
+ "devDependencies": {
+ "mkdirp": "^0.5.0",
+ "rimraf": "^2.3.3",
+ "tap": "^5.1.1"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "c8b2eeea6b8c1659fa7c1dd4fdaabe9533dc5e8b",
+ "tarball": "https://registry.npmjs.org/which/-/which-1.2.11.tgz"
+ },
+ "files": [
+ "which.js",
+ "bin/which"
+ ],
+ "gitHead": "8a7d0aa1ca10173f9f4d84bf528a3efc1f5d0c6f",
+ "homepage": "https://github.com/isaacs/node-which#readme",
+ "license": "ISC",
+ "main": "which.js",
+ "maintainers": [
+ {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ }
+ ],
+ "name": "which",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/node-which.git"
+ },
+ "scripts": {
+ "changelog": "bash gen-changelog.sh",
+ "postversion": "npm run changelog && git add CHANGELOG.md && git commit -m 'update changelog - '${npm_package_version}",
+ "test": "tap test/*.js --cov"
+ },
+ "version": "1.2.11"
+}
diff --git a/node_modules/which/which.js b/node_modules/which/which.js
new file mode 100644
index 000000000..5a9b15ca6
--- /dev/null
+++ b/node_modules/which/which.js
@@ -0,0 +1,133 @@
+module.exports = which
+which.sync = whichSync
+
+var isWindows = process.platform === 'win32' ||
+ process.env.OSTYPE === 'cygwin' ||
+ process.env.OSTYPE === 'msys'
+
+var path = require('path')
+var COLON = isWindows ? ';' : ':'
+var isexe = require('isexe')
+var fs = require('fs')
+
+function getNotFoundError (cmd) {
+ var er = new Error('not found: ' + cmd)
+ er.code = 'ENOENT'
+
+ return er
+}
+
+function getPathInfo (cmd, opt) {
+ var colon = opt.colon || COLON
+ var pathEnv = opt.path || process.env.PATH || ''
+ var pathExt = ['']
+
+ pathEnv = pathEnv.split(colon)
+
+ var pathExtExe = ''
+ if (isWindows) {
+ pathEnv.unshift(process.cwd())
+ pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
+ pathExt = pathExtExe.split(colon)
+
+
+ // Always test the cmd itself first. isexe will check to make sure
+ // it's found in the pathExt set.
+ if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
+ pathExt.unshift('')
+ }
+
+ // If it has a slash, then we don't bother searching the pathenv.
+ // just check the file itself, and that's it.
+ if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
+ pathEnv = ['']
+
+ return {
+ env: pathEnv,
+ ext: pathExt,
+ extExe: pathExtExe
+ }
+}
+
+function which (cmd, opt, cb) {
+ if (typeof opt === 'function') {
+ cb = opt
+ opt = {}
+ }
+
+ var info = getPathInfo(cmd, opt)
+ var pathEnv = info.env
+ var pathExt = info.ext
+ var pathExtExe = info.extExe
+ var found = []
+
+ ;(function F (i, l) {
+ if (i === l) {
+ if (opt.all && found.length)
+ return cb(null, found)
+ else
+ return cb(getNotFoundError(cmd))
+ }
+
+ var pathPart = pathEnv[i]
+ if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
+ pathPart = pathPart.slice(1, -1)
+
+ var p = path.join(pathPart, cmd)
+ if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
+ p = cmd.slice(0, 2) + p
+ }
+ ;(function E (ii, ll) {
+ if (ii === ll) return F(i + 1, l)
+ var ext = pathExt[ii]
+ isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
+ if (!er && is) {
+ if (opt.all)
+ found.push(p + ext)
+ else
+ return cb(null, p + ext)
+ }
+ return E(ii + 1, ll)
+ })
+ })(0, pathExt.length)
+ })(0, pathEnv.length)
+}
+
+function whichSync (cmd, opt) {
+ opt = opt || {}
+
+ var info = getPathInfo(cmd, opt)
+ var pathEnv = info.env
+ var pathExt = info.ext
+ var pathExtExe = info.extExe
+ var found = []
+
+ for (var i = 0, l = pathEnv.length; i < l; i ++) {
+ var pathPart = pathEnv[i]
+ if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
+ pathPart = pathPart.slice(1, -1)
+
+ var p = path.join(pathPart, cmd)
+ if (!pathPart && /^\.[\\\/]/.test(cmd)) {
+ p = cmd.slice(0, 2) + p
+ }
+ for (var j = 0, ll = pathExt.length; j < ll; j ++) {
+ var cur = p + pathExt[j]
+ var is
+ try {
+ is = isexe.sync(cur, { pathExt: pathExtExe })
+ if (is) {
+ if (opt.all)
+ found.push(cur)
+ else
+ return cur
+ }
+ } catch (ex) {}
+ }
+ }
+
+ if (opt.all && found.length)
+ return found
+
+ throw getNotFoundError(cmd)
+}