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
path: root/bin
diff options
context:
space:
mode:
authorPhillip Howell <phowell@cothm.org>2012-05-21 21:26:42 +0400
committerisaacs <i@izs.me>2012-06-17 23:14:33 +0400
commitc2daa506da847c5c161121410e2780cad789ff8b (patch)
tree5cea73700a1241add7d745e955193e4214ce81e3 /bin
parent173091bcfb03d2199fb5d499d7864a907994a01d (diff)
Fix #2465: Make npm script and windows shims cygwin-aware
Diffstat (limited to 'bin')
-rwxr-xr-xbin/npm13
1 files changed, 10 insertions, 3 deletions
diff --git a/bin/npm b/bin/npm
index 5fbcd3b03..07ade35e0 100755
--- a/bin/npm
+++ b/bin/npm
@@ -1,6 +1,13 @@
#!/bin/sh
-if [ -x "`dirname "$0"`/node.exe" ]; then
- "`dirname "$0"`/node.exe" "`dirname "$0"`/node_modules/npm/bin/npm-cli.js" "$@"
+
+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" "$@"
else
- node "`dirname "$0"`/node_modules/npm/bin/npm-cli.js" "$@"
+ node "$basedir/node_modules/npm/bin/npm-cli.js" "$@"
fi