Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2014-08-01 04:54:30 +0400
committerisaacs <i@izs.me>2014-08-01 04:54:38 +0400
commitc0119f809506ed8733355505bd7c761ff834dcc5 (patch)
tree8d0a06a2d011963cd64460648f9637fbb4b65d36 /node_modules/cmd-shim
parentea547e29f1245e516fc67641875841c10f04e1ee (diff)
parent5ae6ba7daeb3aad39d09095a8f08cf80f3f435a5 (diff)
merge v1.4
Diffstat (limited to 'node_modules/cmd-shim')
-rw-r--r--node_modules/cmd-shim/README.md4
-rw-r--r--node_modules/cmd-shim/index.js4
-rw-r--r--node_modules/cmd-shim/node_modules/graceful-fs/.npmignore1
-rw-r--r--node_modules/cmd-shim/node_modules/graceful-fs/LICENSE27
-rw-r--r--node_modules/cmd-shim/node_modules/graceful-fs/README.md26
-rw-r--r--node_modules/cmd-shim/node_modules/graceful-fs/graceful-fs.js160
-rw-r--r--node_modules/cmd-shim/node_modules/graceful-fs/package.json64
-rw-r--r--node_modules/cmd-shim/node_modules/graceful-fs/polyfills.js228
-rw-r--r--node_modules/cmd-shim/node_modules/graceful-fs/test/open.js39
-rw-r--r--node_modules/cmd-shim/node_modules/graceful-fs/test/readdir-sort.js21
-rw-r--r--node_modules/cmd-shim/package.json36
-rw-r--r--node_modules/cmd-shim/test/basic.js8
12 files changed, 606 insertions, 12 deletions
diff --git a/node_modules/cmd-shim/README.md b/node_modules/cmd-shim/README.md
index fb997d5db..5c6bfa063 100644
--- a/node_modules/cmd-shim/README.md
+++ b/node_modules/cmd-shim/README.md
@@ -5,7 +5,9 @@ since symlinks are not suitable for this purpose there.
On Unix systems, you should use a symbolic link instead.
-[![Build Status](https://travis-ci.org/ForbesLindesay/cmd-shim.png?branch=master)](https://travis-ci.org/ForbesLindesay/cmd-shim) [![Dependency Status](https://gemnasium.com/ForbesLindesay/cmd-shim.png)](https://gemnasium.com/ForbesLindesay/cmd-shim)
+[![Build Status](https://img.shields.io/travis/ForbesLindesay/cmd-shim/master.svg)](https://travis-ci.org/ForbesLindesay/cmd-shim)
+[![Dependency Status](https://img.shields.io/gemnasium/ForbesLindesay/cmd-shim.svg)](https://gemnasium.com/ForbesLindesay/cmd-shim)
+[![NPM version](https://img.shields.io/npm/v/cmd-shim.svg)](http://badge.fury.io/js/cmd-shim)
## Installation
diff --git a/node_modules/cmd-shim/index.js b/node_modules/cmd-shim/index.js
index 1cfd24edc..12452e3a7 100644
--- a/node_modules/cmd-shim/index.js
+++ b/node_modules/cmd-shim/index.js
@@ -99,6 +99,8 @@ function writeShim_ (from, to, prog, args, cb) {
// @IF EXIST "%~dp0\node.exe" (
// "%~dp0\node.exe" "%~dp0\.\node_modules\npm\bin\npm-cli.js" %*
// ) ELSE (
+ // SETLOCAL
+ // SET PATHEXT=%PATHEXT:;.JS;=;%
// node "%~dp0\.\node_modules\npm\bin\npm-cli.js" %*
// )
var cmd
@@ -106,6 +108,8 @@ function writeShim_ (from, to, prog, args, cb) {
cmd = "@IF EXIST " + longProg + " (\r\n"
+ " " + longProg + " " + args + " " + target + " %*\r\n"
+ ") ELSE (\r\n"
+ + " @SETLOCAL\r\n"
+ + " @SET PATHEXT=%PATHEXT:;.JS;=;%\r\n"
+ " " + prog + " " + args + " " + target + " %*\r\n"
+ ")"
} else {
diff --git a/node_modules/cmd-shim/node_modules/graceful-fs/.npmignore b/node_modules/cmd-shim/node_modules/graceful-fs/.npmignore
new file mode 100644
index 000000000..c2658d7d1
--- /dev/null
+++ b/node_modules/cmd-shim/node_modules/graceful-fs/.npmignore
@@ -0,0 +1 @@
+node_modules/
diff --git a/node_modules/cmd-shim/node_modules/graceful-fs/LICENSE b/node_modules/cmd-shim/node_modules/graceful-fs/LICENSE
new file mode 100644
index 000000000..0c44ae716
--- /dev/null
+++ b/node_modules/cmd-shim/node_modules/graceful-fs/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) Isaac Z. Schlueter ("Author")
+All rights reserved.
+
+The BSD License
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/node_modules/cmd-shim/node_modules/graceful-fs/README.md b/node_modules/cmd-shim/node_modules/graceful-fs/README.md
new file mode 100644
index 000000000..eb1a10935
--- /dev/null
+++ b/node_modules/cmd-shim/node_modules/graceful-fs/README.md
@@ -0,0 +1,26 @@
+# graceful-fs
+
+graceful-fs functions as a drop-in replacement for the fs module,
+making various improvements.
+
+The improvements are meant to normalize behavior across different
+platforms and environments, and to make filesystem access more
+resilient to errors.
+
+## Improvements over fs module
+
+graceful-fs:
+
+* Queues up `open` and `readdir` calls, and retries them once
+ something closes if there is an EMFILE error from too many file
+ descriptors.
+* fixes `lchmod` for Node versions prior to 0.6.2.
+* implements `fs.lutimes` if possible. Otherwise it becomes a noop.
+* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or
+ `lchown` if the user isn't root.
+* makes `lchmod` and `lchown` become noops, if not available.
+* retries reading a file if `read` results in EAGAIN error.
+
+On Windows, it retries renaming a file for up to one second if `EACCESS`
+or `EPERM` error occurs, likely because antivirus software has locked
+the directory.
diff --git a/node_modules/cmd-shim/node_modules/graceful-fs/graceful-fs.js b/node_modules/cmd-shim/node_modules/graceful-fs/graceful-fs.js
new file mode 100644
index 000000000..c84db9101
--- /dev/null
+++ b/node_modules/cmd-shim/node_modules/graceful-fs/graceful-fs.js
@@ -0,0 +1,160 @@
+// Monkey-patching the fs module.
+// It's ugly, but there is simply no other way to do this.
+var fs = module.exports = require('fs')
+
+var assert = require('assert')
+
+// fix up some busted stuff, mostly on windows and old nodes
+require('./polyfills.js')
+
+// The EMFILE enqueuing stuff
+
+var util = require('util')
+
+function noop () {}
+
+var debug = noop
+if (util.debuglog)
+ debug = util.debuglog('gfs')
+else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || ''))
+ debug = function() {
+ var m = util.format.apply(util, arguments)
+ m = 'GFS: ' + m.split(/\n/).join('\nGFS: ')
+ console.error(m)
+ }
+
+if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) {
+ process.on('exit', function() {
+ debug('fds', fds)
+ debug(queue)
+ assert.equal(queue.length, 0)
+ })
+}
+
+
+var originalOpen = fs.open
+fs.open = open
+
+function open(path, flags, mode, cb) {
+ if (typeof mode === "function") cb = mode, mode = null
+ if (typeof cb !== "function") cb = noop
+ new OpenReq(path, flags, mode, cb)
+}
+
+function OpenReq(path, flags, mode, cb) {
+ this.path = path
+ this.flags = flags
+ this.mode = mode
+ this.cb = cb
+ Req.call(this)
+}
+
+util.inherits(OpenReq, Req)
+
+OpenReq.prototype.process = function() {
+ originalOpen.call(fs, this.path, this.flags, this.mode, this.done)
+}
+
+var fds = {}
+OpenReq.prototype.done = function(er, fd) {
+ debug('open done', er, fd)
+ if (fd)
+ fds['fd' + fd] = this.path
+ Req.prototype.done.call(this, er, fd)
+}
+
+
+var originalReaddir = fs.readdir
+fs.readdir = readdir
+
+function readdir(path, cb) {
+ if (typeof cb !== "function") cb = noop
+ new ReaddirReq(path, cb)
+}
+
+function ReaddirReq(path, cb) {
+ this.path = path
+ this.cb = cb
+ Req.call(this)
+}
+
+util.inherits(ReaddirReq, Req)
+
+ReaddirReq.prototype.process = function() {
+ originalReaddir.call(fs, this.path, this.done)
+}
+
+ReaddirReq.prototype.done = function(er, files) {
+ if (files && files.sort)
+ files = files.sort()
+ Req.prototype.done.call(this, er, files)
+ onclose()
+}
+
+
+var originalClose = fs.close
+fs.close = close
+
+function close (fd, cb) {
+ debug('close', fd)
+ if (typeof cb !== "function") cb = noop
+ delete fds['fd' + fd]
+ originalClose.call(fs, fd, function(er) {
+ onclose()
+ cb(er)
+ })
+}
+
+
+var originalCloseSync = fs.closeSync
+fs.closeSync = closeSync
+
+function closeSync (fd) {
+ try {
+ return originalCloseSync(fd)
+ } finally {
+ onclose()
+ }
+}
+
+
+// Req class
+function Req () {
+ // start processing
+ this.done = this.done.bind(this)
+ this.failures = 0
+ this.process()
+}
+
+Req.prototype.done = function (er, result) {
+ var tryAgain = false
+ if (er) {
+ var code = er.code
+ var tryAgain = code === "EMFILE"
+ if (process.platform === "win32")
+ tryAgain = tryAgain || code === "OK"
+ }
+
+ if (tryAgain) {
+ this.failures ++
+ enqueue(this)
+ } else {
+ var cb = this.cb
+ cb(er, result)
+ }
+}
+
+var queue = []
+
+function enqueue(req) {
+ queue.push(req)
+ debug('enqueue %d %s', queue.length, req.constructor.name, req)
+}
+
+function onclose() {
+ var req = queue.shift()
+ if (req) {
+ debug('process', req.constructor.name, req)
+ req.process()
+ }
+}
diff --git a/node_modules/cmd-shim/node_modules/graceful-fs/package.json b/node_modules/cmd-shim/node_modules/graceful-fs/package.json
new file mode 100644
index 000000000..8d3af78fd
--- /dev/null
+++ b/node_modules/cmd-shim/node_modules/graceful-fs/package.json
@@ -0,0 +1,64 @@
+{
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me",
+ "url": "http://blog.izs.me"
+ },
+ "name": "graceful-fs",
+ "description": "A drop-in replacement for fs, making various improvements.",
+ "version": "2.0.3",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/node-graceful-fs.git"
+ },
+ "main": "graceful-fs.js",
+ "engines": {
+ "node": ">=0.4.0"
+ },
+ "directories": {
+ "test": "test"
+ },
+ "scripts": {
+ "test": "tap test/*.js"
+ },
+ "keywords": [
+ "fs",
+ "module",
+ "reading",
+ "retry",
+ "retries",
+ "queue",
+ "error",
+ "errors",
+ "handling",
+ "EMFILE",
+ "EAGAIN",
+ "EINVAL",
+ "EPERM",
+ "EACCESS"
+ ],
+ "license": "BSD",
+ "bugs": {
+ "url": "https://github.com/isaacs/node-graceful-fs/issues"
+ },
+ "homepage": "https://github.com/isaacs/node-graceful-fs",
+ "_id": "graceful-fs@2.0.3",
+ "dist": {
+ "shasum": "7cd2cdb228a4a3f36e95efa6cc142de7d1a136d0",
+ "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz"
+ },
+ "_from": "graceful-fs@>=2.0.0-0 <3.0.0-0",
+ "_npmVersion": "1.4.6",
+ "_npmUser": {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ },
+ "maintainers": [
+ {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ }
+ ],
+ "_shasum": "7cd2cdb228a4a3f36e95efa6cc142de7d1a136d0",
+ "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz"
+}
diff --git a/node_modules/cmd-shim/node_modules/graceful-fs/polyfills.js b/node_modules/cmd-shim/node_modules/graceful-fs/polyfills.js
new file mode 100644
index 000000000..afc83b3f2
--- /dev/null
+++ b/node_modules/cmd-shim/node_modules/graceful-fs/polyfills.js
@@ -0,0 +1,228 @@
+var fs = require('fs')
+var constants = require('constants')
+
+var origCwd = process.cwd
+var cwd = null
+process.cwd = function() {
+ if (!cwd)
+ cwd = origCwd.call(process)
+ return cwd
+}
+var chdir = process.chdir
+process.chdir = function(d) {
+ cwd = null
+ chdir.call(process, d)
+}
+
+// (re-)implement some things that are known busted or missing.
+
+// lchmod, broken prior to 0.6.2
+// back-port the fix here.
+if (constants.hasOwnProperty('O_SYMLINK') &&
+ process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
+ fs.lchmod = function (path, mode, callback) {
+ callback = callback || noop
+ fs.open( path
+ , constants.O_WRONLY | constants.O_SYMLINK
+ , mode
+ , function (err, fd) {
+ if (err) {
+ callback(err)
+ return
+ }
+ // prefer to return the chmod error, if one occurs,
+ // but still try to close, and report closing errors if they occur.
+ fs.fchmod(fd, mode, function (err) {
+ fs.close(fd, function(err2) {
+ callback(err || err2)
+ })
+ })
+ })
+ }
+
+ fs.lchmodSync = function (path, mode) {
+ var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)
+
+ // prefer to return the chmod error, if one occurs,
+ // but still try to close, and report closing errors if they occur.
+ var err, err2
+ try {
+ var ret = fs.fchmodSync(fd, mode)
+ } catch (er) {
+ err = er
+ }
+ try {
+ fs.closeSync(fd)
+ } catch (er) {
+ err2 = er
+ }
+ if (err || err2) throw (err || err2)
+ return ret
+ }
+}
+
+
+// lutimes implementation, or no-op
+if (!fs.lutimes) {
+ if (constants.hasOwnProperty("O_SYMLINK")) {
+ fs.lutimes = function (path, at, mt, cb) {
+ fs.open(path, constants.O_SYMLINK, function (er, fd) {
+ cb = cb || noop
+ if (er) return cb(er)
+ fs.futimes(fd, at, mt, function (er) {
+ fs.close(fd, function (er2) {
+ return cb(er || er2)
+ })
+ })
+ })
+ }
+
+ fs.lutimesSync = function (path, at, mt) {
+ var fd = fs.openSync(path, constants.O_SYMLINK)
+ , err
+ , err2
+ , ret
+
+ try {
+ var ret = fs.futimesSync(fd, at, mt)
+ } catch (er) {
+ err = er
+ }
+ try {
+ fs.closeSync(fd)
+ } catch (er) {
+ err2 = er
+ }
+ if (err || err2) throw (err || err2)
+ return ret
+ }
+
+ } else if (fs.utimensat && constants.hasOwnProperty("AT_SYMLINK_NOFOLLOW")) {
+ // maybe utimensat will be bound soonish?
+ fs.lutimes = function (path, at, mt, cb) {
+ fs.utimensat(path, at, mt, constants.AT_SYMLINK_NOFOLLOW, cb)
+ }
+
+ fs.lutimesSync = function (path, at, mt) {
+ return fs.utimensatSync(path, at, mt, constants.AT_SYMLINK_NOFOLLOW)
+ }
+
+ } else {
+ fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) }
+ fs.lutimesSync = function () {}
+ }
+}
+
+
+// https://github.com/isaacs/node-graceful-fs/issues/4
+// Chown should not fail on einval or eperm if non-root.
+
+fs.chown = chownFix(fs.chown)
+fs.fchown = chownFix(fs.fchown)
+fs.lchown = chownFix(fs.lchown)
+
+fs.chownSync = chownFixSync(fs.chownSync)
+fs.fchownSync = chownFixSync(fs.fchownSync)
+fs.lchownSync = chownFixSync(fs.lchownSync)
+
+function chownFix (orig) {
+ if (!orig) return orig
+ return function (target, uid, gid, cb) {
+ return orig.call(fs, target, uid, gid, function (er, res) {
+ if (chownErOk(er)) er = null
+ cb(er, res)
+ })
+ }
+}
+
+function chownFixSync (orig) {
+ if (!orig) return orig
+ return function (target, uid, gid) {
+ try {
+ return orig.call(fs, target, uid, gid)
+ } catch (er) {
+ if (!chownErOk(er)) throw er
+ }
+ }
+}
+
+function chownErOk (er) {
+ // if there's no getuid, or if getuid() is something other than 0,
+ // and the error is EINVAL or EPERM, then just ignore it.
+ // This specific case is a silent failure in cp, install, tar,
+ // and most other unix tools that manage permissions.
+ // When running as root, or if other types of errors are encountered,
+ // then it's strict.
+ if (!er || (!process.getuid || process.getuid() !== 0)
+ && (er.code === "EINVAL" || er.code === "EPERM")) return true
+}
+
+
+// if lchmod/lchown do not exist, then make them no-ops
+if (!fs.lchmod) {
+ fs.lchmod = function (path, mode, cb) {
+ process.nextTick(cb)
+ }
+ fs.lchmodSync = function () {}
+}
+if (!fs.lchown) {
+ fs.lchown = function (path, uid, gid, cb) {
+ process.nextTick(cb)
+ }
+ fs.lchownSync = function () {}
+}
+
+
+
+// on Windows, A/V software can lock the directory, causing this
+// to fail with an EACCES or EPERM if the directory contains newly
+// created files. Try again on failure, for up to 1 second.
+if (process.platform === "win32") {
+ var rename_ = fs.rename
+ fs.rename = function rename (from, to, cb) {
+ var start = Date.now()
+ rename_(from, to, function CB (er) {
+ if (er
+ && (er.code === "EACCES" || er.code === "EPERM")
+ && Date.now() - start < 1000) {
+ return rename_(from, to, CB)
+ }
+ cb(er)
+ })
+ }
+}
+
+
+// if read() returns EAGAIN, then just try it again.
+var read = fs.read
+fs.read = function (fd, buffer, offset, length, position, callback_) {
+ var callback
+ if (callback_ && typeof callback_ === 'function') {
+ var eagCounter = 0
+ callback = function (er, _, __) {
+ if (er && er.code === 'EAGAIN' && eagCounter < 10) {
+ eagCounter ++
+ return read.call(fs, fd, buffer, offset, length, position, callback)
+ }
+ callback_.apply(this, arguments)
+ }
+ }
+ return read.call(fs, fd, buffer, offset, length, position, callback)
+}
+
+var readSync = fs.readSync
+fs.readSync = function (fd, buffer, offset, length, position) {
+ var eagCounter = 0
+ while (true) {
+ try {
+ return readSync.call(fs, fd, buffer, offset, length, position)
+ } catch (er) {
+ if (er.code === 'EAGAIN' && eagCounter < 10) {
+ eagCounter ++
+ continue
+ }
+ throw er
+ }
+ }
+}
+
diff --git a/node_modules/cmd-shim/node_modules/graceful-fs/test/open.js b/node_modules/cmd-shim/node_modules/graceful-fs/test/open.js
new file mode 100644
index 000000000..104f36b0b
--- /dev/null
+++ b/node_modules/cmd-shim/node_modules/graceful-fs/test/open.js
@@ -0,0 +1,39 @@
+var test = require('tap').test
+var fs = require('../graceful-fs.js')
+
+test('graceful fs is monkeypatched fs', function (t) {
+ t.equal(fs, require('fs'))
+ t.end()
+})
+
+test('open an existing file works', function (t) {
+ var fd = fs.openSync(__filename, 'r')
+ fs.closeSync(fd)
+ fs.open(__filename, 'r', function (er, fd) {
+ if (er) throw er
+ fs.close(fd, function (er) {
+ if (er) throw er
+ t.pass('works')
+ t.end()
+ })
+ })
+})
+
+test('open a non-existing file throws', function (t) {
+ var er
+ try {
+ var fd = fs.openSync('this file does not exist', 'r')
+ } catch (x) {
+ er = x
+ }
+ t.ok(er, 'should throw')
+ t.notOk(fd, 'should not get an fd')
+ t.equal(er.code, 'ENOENT')
+
+ fs.open('neither does this file', 'r', function (er, fd) {
+ t.ok(er, 'should throw')
+ t.notOk(fd, 'should not get an fd')
+ t.equal(er.code, 'ENOENT')
+ t.end()
+ })
+})
diff --git a/node_modules/cmd-shim/node_modules/graceful-fs/test/readdir-sort.js b/node_modules/cmd-shim/node_modules/graceful-fs/test/readdir-sort.js
new file mode 100644
index 000000000..aeaedf1c1
--- /dev/null
+++ b/node_modules/cmd-shim/node_modules/graceful-fs/test/readdir-sort.js
@@ -0,0 +1,21 @@
+var test = require("tap").test
+var fs = require("fs")
+
+var readdir = fs.readdir
+fs.readdir = function(path, cb) {
+ process.nextTick(function() {
+ cb(null, ["b", "z", "a"])
+ })
+}
+
+var g = require("../")
+
+test("readdir reorder", function (t) {
+ g.readdir("whatevers", function (er, files) {
+ if (er)
+ throw er
+ console.error(files)
+ t.same(files, [ "a", "b", "z" ])
+ t.end()
+ })
+})
diff --git a/node_modules/cmd-shim/package.json b/node_modules/cmd-shim/package.json
index 32e80606f..eebd59ecb 100644
--- a/node_modules/cmd-shim/package.json
+++ b/node_modules/cmd-shim/package.json
@@ -1,6 +1,6 @@
{
"name": "cmd-shim",
- "version": "1.1.1",
+ "version": "1.1.2",
"description": "Used in npm for command line application support",
"scripts": {
"test": "tap test/*.js"
@@ -11,25 +11,39 @@
},
"license": "BSD",
"optionalDependencies": {
- "graceful-fs": "2 || 3"
+ "graceful-fs": "2"
},
"dependencies": {
- "mkdirp": "~0.3.3",
+ "mkdirp": "~0.5.0",
"graceful-fs": "2"
},
"devDependencies": {
- "tap": "~0.4.1",
- "rimraf": "~2.1.4"
+ "tap": "~0.4.11",
+ "rimraf": "~2.2.8"
},
- "readme": "# cmd-shim\r\n\r\nThe cmd-shim used in npm to create executable scripts on Windows,\r\nsince symlinks are not suitable for this purpose there.\r\n\r\nOn Unix systems, you should use a symbolic link instead.\r\n\r\n[![Build Status](https://travis-ci.org/ForbesLindesay/cmd-shim.png?branch=master)](https://travis-ci.org/ForbesLindesay/cmd-shim) [![Dependency Status](https://gemnasium.com/ForbesLindesay/cmd-shim.png)](https://gemnasium.com/ForbesLindesay/cmd-shim)\r\n\r\n## Installation\r\n\r\n```\r\nnpm install cmd-shim\r\n```\r\n\r\n## API\r\n\r\n### cmdShim(from, to, cb)\r\n\r\nCreate a cmd shim at `to` for the command line program at `from`.\r\ne.g.\r\n\r\n```javascript\r\nvar cmdShim = require('cmd-shim');\r\ncmdShim(__dirname + '/cli.js', '/usr/bin/command-name', function (err) {\r\n if (err) throw err;\r\n});\r\n```\r\n\r\n### cmdShim.ifExists(from, to, cb)\r\n\r\nThe same as above, but will just continue if the file does not exist.\r\nSource:\r\n\r\n```javascript\r\nfunction cmdShimIfExists (from, to, cb) {\r\n fs.stat(from, function (er) {\r\n if (er) return cb()\r\n cmdShim(from, to, cb)\r\n })\r\n}\r\n```\r\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/ForbesLindesay/cmd-shim/issues"
},
- "_id": "cmd-shim@1.1.1",
+ "homepage": "https://github.com/ForbesLindesay/cmd-shim",
+ "_id": "cmd-shim@1.1.2",
"dist": {
- "shasum": "87741e2a8b6307ea1ea8bf1f65287cb4a9ca977a"
+ "shasum": "e4f9198802e361e8eb43b591959ef4dc6cdb6754",
+ "tarball": "http://registry.npmjs.org/cmd-shim/-/cmd-shim-1.1.2.tgz"
+ },
+ "_from": "cmd-shim@~1.1.1",
+ "_npmVersion": "1.4.3",
+ "_npmUser": {
+ "name": "forbeslindesay",
+ "email": "forbes@lindeay.co.uk"
},
- "_from": "cmd-shim@latest",
- "_resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-1.1.1.tgz"
+ "maintainers": [
+ {
+ "name": "forbeslindesay",
+ "email": "forbes@lindesay.co.uk"
+ }
+ ],
+ "directories": {},
+ "_shasum": "e4f9198802e361e8eb43b591959ef4dc6cdb6754",
+ "_resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-1.1.2.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/node_modules/cmd-shim/test/basic.js b/node_modules/cmd-shim/test/basic.js
index 93da5ea26..004bf9d5c 100644
--- a/node_modules/cmd-shim/test/basic.js
+++ b/node_modules/cmd-shim/test/basic.js
@@ -50,6 +50,8 @@ test('env shebang', function (t) {
"@IF EXIST \"%~dp0\\node.exe\" (\r"+
"\n \"%~dp0\\node.exe\" \"%~dp0\\from.env\" %*\r"+
"\n) ELSE (\r"+
+ "\n @SETLOCAL\r"+
+ "\n @SET PATHEXT=%PATHEXT:;.JS;=;%\r"+
"\n node \"%~dp0\\from.env\" %*\r"+
"\n)")
t.end()
@@ -86,6 +88,8 @@ test('env shebang with args', function (t) {
"@IF EXIST \"%~dp0\\node.exe\" (\r"+
"\n \"%~dp0\\node.exe\" --expose_gc \"%~dp0\\from.env.args\" %*\r"+
"\n) ELSE (\r"+
+ "\n @SETLOCAL\r"+
+ "\n @SET PATHEXT=%PATHEXT:;.JS;=;%\r"+
"\n node --expose_gc \"%~dp0\\from.env.args\" %*\r"+
"\n)")
t.end()
@@ -123,6 +127,8 @@ test('explicit shebang', function (t) {
"@IF EXIST \"%~dp0\\/usr/bin/sh.exe\" (\r" +
"\n \"%~dp0\\/usr/bin/sh.exe\" \"%~dp0\\from.sh\" %*\r" +
"\n) ELSE (\r" +
+ "\n @SETLOCAL\r"+
+ "\n @SET PATHEXT=%PATHEXT:;.JS;=;%\r"+
"\n /usr/bin/sh \"%~dp0\\from.sh\" %*\r" +
"\n)")
t.end()
@@ -160,6 +166,8 @@ test('explicit shebang with args', function (t) {
"@IF EXIST \"%~dp0\\/usr/bin/sh.exe\" (\r" +
"\n \"%~dp0\\/usr/bin/sh.exe\" -x \"%~dp0\\from.sh.args\" %*\r" +
"\n) ELSE (\r" +
+ "\n @SETLOCAL\r"+
+ "\n @SET PATHEXT=%PATHEXT:;.JS;=;%\r"+
"\n /usr/bin/sh -x \"%~dp0\\from.sh.args\" %*\r" +
"\n)")
t.end()