summaryrefslogtreecommitdiff
path: root/deps/node/deps/npm/node_modules/cmd-shim
diff options
context:
space:
mode:
Diffstat (limited to 'deps/node/deps/npm/node_modules/cmd-shim')
-rw-r--r--deps/node/deps/npm/node_modules/cmd-shim/.npmignore16
-rw-r--r--deps/node/deps/npm/node_modules/cmd-shim/.travis.yml4
-rw-r--r--deps/node/deps/npm/node_modules/cmd-shim/LICENSE27
-rw-r--r--deps/node/deps/npm/node_modules/cmd-shim/README.md44
-rw-r--r--deps/node/deps/npm/node_modules/cmd-shim/index.js180
-rw-r--r--deps/node/deps/npm/node_modules/cmd-shim/package.json54
-rw-r--r--deps/node/deps/npm/node_modules/cmd-shim/test/00-setup.js34
-rwxr-xr-xdeps/node/deps/npm/node_modules/cmd-shim/test/basic.js175
-rw-r--r--deps/node/deps/npm/node_modules/cmd-shim/test/zz-cleanup.js13
9 files changed, 0 insertions, 547 deletions
diff --git a/deps/node/deps/npm/node_modules/cmd-shim/.npmignore b/deps/node/deps/npm/node_modules/cmd-shim/.npmignore
deleted file mode 100644
index 699b5d4f..00000000
--- a/deps/node/deps/npm/node_modules/cmd-shim/.npmignore
+++ /dev/null
@@ -1,16 +0,0 @@
-lib-cov
-*.seed
-*.log
-*.csv
-*.dat
-*.out
-*.pid
-*.gz
-
-pids
-logs
-results
-
-npm-debug.log
-
-node_modules
diff --git a/deps/node/deps/npm/node_modules/cmd-shim/.travis.yml b/deps/node/deps/npm/node_modules/cmd-shim/.travis.yml
deleted file mode 100644
index 2ca91f28..00000000
--- a/deps/node/deps/npm/node_modules/cmd-shim/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: node_js
-node_js:
- - "0.10"
- - "0.8" \ No newline at end of file
diff --git a/deps/node/deps/npm/node_modules/cmd-shim/LICENSE b/deps/node/deps/npm/node_modules/cmd-shim/LICENSE
deleted file mode 100644
index 0c44ae71..00000000
--- a/deps/node/deps/npm/node_modules/cmd-shim/LICENSE
+++ /dev/null
@@ -1,27 +0,0 @@
-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/deps/node/deps/npm/node_modules/cmd-shim/README.md b/deps/node/deps/npm/node_modules/cmd-shim/README.md
deleted file mode 100644
index ff6745f8..00000000
--- a/deps/node/deps/npm/node_modules/cmd-shim/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-# cmd-shim
-
-The cmd-shim used in npm to create executable scripts on Windows,
-since symlinks are not suitable for this purpose there.
-
-On Unix systems, you should use a symbolic link instead.
-
-[![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/david/ForbesLindesay/cmd-shim.svg)](https://david-dm.org/ForbesLindesay/cmd-shim)
-[![NPM version](https://img.shields.io/npm/v/cmd-shim.svg)](https://www.npmjs.com/package/cmd-shim)
-
-## Installation
-
-```
-npm install cmd-shim
-```
-
-## API
-
-### cmdShim(from, to, cb)
-
-Create a cmd shim at `to` for the command line program at `from`.
-e.g.
-
-```javascript
-var cmdShim = require('cmd-shim');
-cmdShim(__dirname + '/cli.js', '/usr/bin/command-name', function (err) {
- if (err) throw err;
-});
-```
-
-### cmdShim.ifExists(from, to, cb)
-
-The same as above, but will just continue if the file does not exist.
-Source:
-
-```javascript
-function cmdShimIfExists (from, to, cb) {
- fs.stat(from, function (er) {
- if (er) return cb()
- cmdShim(from, to, cb)
- })
-}
-```
diff --git a/deps/node/deps/npm/node_modules/cmd-shim/index.js b/deps/node/deps/npm/node_modules/cmd-shim/index.js
deleted file mode 100644
index 9f22e103..00000000
--- a/deps/node/deps/npm/node_modules/cmd-shim/index.js
+++ /dev/null
@@ -1,180 +0,0 @@
-// On windows, create a .cmd file.
-// Read the #! in the file to see what it uses. The vast majority
-// of the time, this will be either:
-// "#!/usr/bin/env <prog> <args...>"
-// or:
-// "#!<prog> <args...>"
-//
-// Write a binroot/pkg.bin + ".cmd" file that has this line in it:
-// @<prog> <args...> %~dp0<target> %*
-
-module.exports = cmdShim
-cmdShim.ifExists = cmdShimIfExists
-
-var fs = require("graceful-fs")
-
-var mkdir = require("mkdirp")
- , path = require("path")
- , shebangExpr = /^#\!\s*(?:\/usr\/bin\/env)?\s*([^ \t]+)(.*)$/
-
-function cmdShimIfExists (from, to, cb) {
- fs.stat(from, function (er) {
- if (er) return cb()
- cmdShim(from, to, cb)
- })
-}
-
-// Try to unlink, but ignore errors.
-// Any problems will surface later.
-function rm (path, cb) {
- fs.unlink(path, function(er) {
- cb()
- })
-}
-
-function cmdShim (from, to, cb) {
- fs.stat(from, function (er, stat) {
- if (er)
- return cb(er)
-
- cmdShim_(from, to, cb)
- })
-}
-
-function cmdShim_ (from, to, cb) {
- var then = times(2, next, cb)
- rm(to, then)
- rm(to + ".cmd", then)
-
- function next(er) {
- writeShim(from, to, cb)
- }
-}
-
-function writeShim (from, to, cb) {
- // make a cmd file and a sh script
- // First, check if the bin is a #! of some sort.
- // If not, then assume it's something that'll be compiled, or some other
- // sort of script, and just call it directly.
- mkdir(path.dirname(to), function (er) {
- if (er)
- return cb(er)
- fs.readFile(from, "utf8", function (er, data) {
- if (er) return writeShim_(from, to, null, null, cb)
- var firstLine = data.trim().split(/\r*\n/)[0]
- , shebang = firstLine.match(shebangExpr)
- if (!shebang) return writeShim_(from, to, null, null, cb)
- var prog = shebang[1]
- , args = shebang[2] || ""
- return writeShim_(from, to, prog, args, cb)
- })
- })
-}
-
-function writeShim_ (from, to, prog, args, cb) {
- var shTarget = path.relative(path.dirname(to), from)
- , target = shTarget.split("/").join("\\")
- , longProg
- , shProg = prog && prog.split("\\").join("/")
- , shLongProg
- shTarget = shTarget.split("\\").join("/")
- args = args || ""
- if (!prog) {
- prog = "\"%~dp0\\" + target + "\""
- shProg = "\"$basedir/" + shTarget + "\""
- args = ""
- target = ""
- shTarget = ""
- } else {
- longProg = "\"%~dp0\\" + prog + ".exe\""
- shLongProg = "\"$basedir/" + prog + "\""
- target = "\"%~dp0\\" + target + "\""
- shTarget = "\"$basedir/" + shTarget + "\""
- }
-
- // @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
- if (longProg) {
- 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 {
- cmd = "@" + prog + " " + args + " " + target + " %*\r\n"
- }
-
- // #!/bin/sh
- // basedir=`dirname "$0"`
- //
- // case `uname` in
- // *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
- // esac
- //
- // if [ -x "$basedir/node.exe" ]; then
- // "$basedir/node.exe" "$basedir/node_modules/npm/bin/npm-cli.js" "$@"
- // ret=$?
- // else
- // node "$basedir/node_modules/npm/bin/npm-cli.js" "$@"
- // ret=$?
- // fi
- // exit $ret
-
- var sh = "#!/bin/sh\n"
-
- if (shLongProg) {
- sh = sh
- + "basedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")\n"
- + "\n"
- + "case `uname` in\n"
- + " *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;\n"
- + "esac\n"
- + "\n"
-
- sh = sh
- + "if [ -x "+shLongProg+" ]; then\n"
- + " " + shLongProg + " " + args + " " + shTarget + " \"$@\"\n"
- + " ret=$?\n"
- + "else \n"
- + " " + shProg + " " + args + " " + shTarget + " \"$@\"\n"
- + " ret=$?\n"
- + "fi\n"
- + "exit $ret\n"
- } else {
- sh = shProg + " " + args + " " + shTarget + " \"$@\"\n"
- + "exit $?\n"
- }
-
- var then = times(2, next, cb)
- fs.writeFile(to + ".cmd", cmd, "utf8", then)
- fs.writeFile(to, sh, "utf8", then)
- function next () {
- chmodShim(to, cb)
- }
-}
-
-function chmodShim (to, cb) {
- var then = times(2, cb, cb)
- fs.chmod(to, 0755, then)
- fs.chmod(to + ".cmd", 0755, then)
-}
-
-function times(n, ok, cb) {
- var errState = null
- return function(er) {
- if (!errState) {
- if (er)
- cb(errState = er)
- else if (--n === 0)
- ok()
- }
- }
-}
diff --git a/deps/node/deps/npm/node_modules/cmd-shim/package.json b/deps/node/deps/npm/node_modules/cmd-shim/package.json
deleted file mode 100644
index 97e73e46..00000000
--- a/deps/node/deps/npm/node_modules/cmd-shim/package.json
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- "_args": [
- [
- "cmd-shim@2.0.2",
- "/Users/rebecca/code/npm"
- ]
- ],
- "_from": "cmd-shim@2.0.2",
- "_id": "cmd-shim@2.0.2",
- "_inBundle": false,
- "_integrity": "sha1-b8vamUg6j9FdfTChlspp1oii79s=",
- "_location": "/cmd-shim",
- "_phantomChildren": {},
- "_requested": {
- "type": "version",
- "registry": true,
- "raw": "cmd-shim@2.0.2",
- "name": "cmd-shim",
- "escapedName": "cmd-shim",
- "rawSpec": "2.0.2",
- "saveSpec": null,
- "fetchSpec": "2.0.2"
- },
- "_requiredBy": [
- "/",
- "/bin-links"
- ],
- "_resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-2.0.2.tgz",
- "_spec": "2.0.2",
- "_where": "/Users/rebecca/code/npm",
- "bugs": {
- "url": "https://github.com/ForbesLindesay/cmd-shim/issues"
- },
- "dependencies": {
- "graceful-fs": "^4.1.2",
- "mkdirp": "~0.5.0"
- },
- "description": "Used in npm for command line application support",
- "devDependencies": {
- "rimraf": "~2.2.8",
- "tap": "~0.4.11"
- },
- "homepage": "https://github.com/ForbesLindesay/cmd-shim#readme",
- "license": "BSD-2-Clause",
- "name": "cmd-shim",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/ForbesLindesay/cmd-shim.git"
- },
- "scripts": {
- "test": "tap test/*.js"
- },
- "version": "2.0.2"
-}
diff --git a/deps/node/deps/npm/node_modules/cmd-shim/test/00-setup.js b/deps/node/deps/npm/node_modules/cmd-shim/test/00-setup.js
deleted file mode 100644
index 04ec2b25..00000000
--- a/deps/node/deps/npm/node_modules/cmd-shim/test/00-setup.js
+++ /dev/null
@@ -1,34 +0,0 @@
-var test = require('tap').test
-var mkdirp = require('mkdirp')
-var fs = require('fs')
-var path = require('path')
-var fixtures = path.resolve(__dirname, 'fixtures')
-
-var froms = {
- 'from.exe': 'exe',
- 'from.env': '#!/usr/bin/env node\nconsole.log(/hi/)\n',
- 'from.env.args': '#!/usr/bin/env node --expose_gc\ngc()\n',
- 'from.sh': '#!/usr/bin/sh\necho hi\n',
- 'from.sh.args': '#!/usr/bin/sh -x\necho hi\n'
-}
-
-var cmdShim = require('../')
-
-test('create fixture', function (t) {
- mkdirp(fixtures, function (er) {
- if (er)
- throw er
- t.pass('made dir')
- Object.keys(froms).forEach(function (f) {
- t.test('write ' + f, function (t) {
- fs.writeFile(path.resolve(fixtures, f), froms[f], function (er) {
- if (er)
- throw er
- t.pass('wrote ' + f)
- t.end()
- })
- })
- })
- t.end()
- })
-})
diff --git a/deps/node/deps/npm/node_modules/cmd-shim/test/basic.js b/deps/node/deps/npm/node_modules/cmd-shim/test/basic.js
deleted file mode 100755
index 09823158..00000000
--- a/deps/node/deps/npm/node_modules/cmd-shim/test/basic.js
+++ /dev/null
@@ -1,175 +0,0 @@
-var test = require('tap').test
-var mkdirp = require('mkdirp')
-var fs = require('fs')
-var path = require('path')
-var fixtures = path.resolve(__dirname, 'fixtures')
-
-var cmdShim = require('../')
-
-test('no shebang', function (t) {
- var from = path.resolve(fixtures, 'from.exe')
- var to = path.resolve(fixtures, 'exe.shim')
- cmdShim(from, to, function(er) {
- if (er)
- throw er
- t.equal(fs.readFileSync(to, 'utf8'),
- "\"$basedir/from.exe\" \"$@\"\nexit $?\n")
- t.equal(fs.readFileSync(to + '.cmd', 'utf8'),
- "@\"%~dp0\\from.exe\" %*\r\n")
- t.end()
- })
-})
-
-test('env shebang', function (t) {
- var from = path.resolve(fixtures, 'from.env')
- var to = path.resolve(fixtures, 'env.shim')
- cmdShim(from, to, function(er) {
- if (er)
- throw er
- console.error('%j', fs.readFileSync(to, 'utf8'))
- console.error('%j', fs.readFileSync(to + '.cmd', 'utf8'))
-
- t.equal(fs.readFileSync(to, 'utf8'),
- "#!/bin/sh"+
- "\nbasedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")"+
- "\n"+
- "\ncase `uname` in"+
- "\n *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;"+
- "\nesac"+
- "\n"+
- "\nif [ -x \"$basedir/node\" ]; then"+
- "\n \"$basedir/node\" \"$basedir/from.env\" \"$@\""+
- "\n ret=$?"+
- "\nelse "+
- "\n node \"$basedir/from.env\" \"$@\""+
- "\n ret=$?"+
- "\nfi"+
- "\nexit $ret"+
- "\n")
- t.equal(fs.readFileSync(to + '.cmd', 'utf8'),
- "@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()
- })
-})
-
-test('env shebang with args', function (t) {
- var from = path.resolve(fixtures, 'from.env.args')
- var to = path.resolve(fixtures, 'env.args.shim')
- cmdShim(from, to, function(er) {
- if (er)
- throw er
- console.error('%j', fs.readFileSync(to, 'utf8'))
- console.error('%j', fs.readFileSync(to + '.cmd', 'utf8'))
-
- t.equal(fs.readFileSync(to, 'utf8'),
- "#!/bin/sh"+
- "\nbasedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")"+
- "\n"+
- "\ncase `uname` in"+
- "\n *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;"+
- "\nesac"+
- "\n"+
- "\nif [ -x \"$basedir/node\" ]; then"+
- "\n \"$basedir/node\" --expose_gc \"$basedir/from.env.args\" \"$@\""+
- "\n ret=$?"+
- "\nelse "+
- "\n node --expose_gc \"$basedir/from.env.args\" \"$@\""+
- "\n ret=$?"+
- "\nfi"+
- "\nexit $ret"+
- "\n")
- t.equal(fs.readFileSync(to + '.cmd', 'utf8'),
- "@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()
- })
-})
-
-test('explicit shebang', function (t) {
- var from = path.resolve(fixtures, 'from.sh')
- var to = path.resolve(fixtures, 'sh.shim')
- cmdShim(from, to, function(er) {
- if (er)
- throw er
- console.error('%j', fs.readFileSync(to, 'utf8'))
- console.error('%j', fs.readFileSync(to + '.cmd', 'utf8'))
-
- t.equal(fs.readFileSync(to, 'utf8'),
- "#!/bin/sh" +
- "\nbasedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")" +
- "\n" +
- "\ncase `uname` in" +
- "\n *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;" +
- "\nesac" +
- "\n" +
- "\nif [ -x \"$basedir//usr/bin/sh\" ]; then" +
- "\n \"$basedir//usr/bin/sh\" \"$basedir/from.sh\" \"$@\"" +
- "\n ret=$?" +
- "\nelse " +
- "\n /usr/bin/sh \"$basedir/from.sh\" \"$@\"" +
- "\n ret=$?" +
- "\nfi" +
- "\nexit $ret" +
- "\n")
-
- t.equal(fs.readFileSync(to + '.cmd', 'utf8'),
- "@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()
- })
-})
-
-test('explicit shebang with args', function (t) {
- var from = path.resolve(fixtures, 'from.sh.args')
- var to = path.resolve(fixtures, 'sh.args.shim')
- cmdShim(from, to, function(er) {
- if (er)
- throw er
- console.error('%j', fs.readFileSync(to, 'utf8'))
- console.error('%j', fs.readFileSync(to + '.cmd', 'utf8'))
-
- t.equal(fs.readFileSync(to, 'utf8'),
- "#!/bin/sh" +
- "\nbasedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")" +
- "\n" +
- "\ncase `uname` in" +
- "\n *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;" +
- "\nesac" +
- "\n" +
- "\nif [ -x \"$basedir//usr/bin/sh\" ]; then" +
- "\n \"$basedir//usr/bin/sh\" -x \"$basedir/from.sh.args\" \"$@\"" +
- "\n ret=$?" +
- "\nelse " +
- "\n /usr/bin/sh -x \"$basedir/from.sh.args\" \"$@\"" +
- "\n ret=$?" +
- "\nfi" +
- "\nexit $ret" +
- "\n")
-
- t.equal(fs.readFileSync(to + '.cmd', 'utf8'),
- "@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()
- })
-})
diff --git a/deps/node/deps/npm/node_modules/cmd-shim/test/zz-cleanup.js b/deps/node/deps/npm/node_modules/cmd-shim/test/zz-cleanup.js
deleted file mode 100644
index 94250310..00000000
--- a/deps/node/deps/npm/node_modules/cmd-shim/test/zz-cleanup.js
+++ /dev/null
@@ -1,13 +0,0 @@
-var test = require('tap').test
-var path = require('path')
-var fixtures = path.resolve(__dirname, 'fixtures')
-var rimraf = require('rimraf')
-
-test('cleanup', function(t) {
- rimraf(fixtures, function(er) {
- if (er)
- throw er
- t.pass('cleaned up')
- t.end()
- })
-})