diff options
author | Phillip Howell <phowell@cothm.org> | 2012-05-21 21:26:42 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-06-17 23:14:33 +0400 |
commit | c2daa506da847c5c161121410e2780cad789ff8b (patch) | |
tree | 5cea73700a1241add7d745e955193e4214ce81e3 /bin | |
parent | 173091bcfb03d2199fb5d499d7864a907994a01d (diff) |
Fix #2465: Make npm script and windows shims cygwin-aware
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/npm | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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 |