1#!/bin/sh 2(set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix 3 4basedir=`dirname "$0"` 5 6case `uname` in 7 *CYGWIN*) basedir=`cygpath -w "$basedir"`;; 8esac 9 10NODE_EXE="$basedir/node.exe" 11if ! [ -x "$NODE_EXE" ]; then 12 NODE_EXE="$basedir/node" 13fi 14if ! [ -x "$NODE_EXE" ]; then 15 NODE_EXE=node 16fi 17 18NPM_CLI_JS="$basedir/node_modules/npm/bin/npm-cli.js" 19 20case `uname` in 21 *MINGW*) 22 NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g` 23 NPM_PREFIX_NPM_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npm-cli.js" 24 if [ -f "$NPM_PREFIX_NPM_CLI_JS" ]; then 25 NPM_CLI_JS="$NPM_PREFIX_NPM_CLI_JS" 26 fi 27 ;; 28 *CYGWIN*) 29 NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g` 30 NPM_PREFIX_NPM_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npm-cli.js" 31 if [ -f "$NPM_PREFIX_NPM_CLI_JS" ]; then 32 NPM_CLI_JS="$NPM_PREFIX_NPM_CLI_JS" 33 fi 34 ;; 35esac 36 37"$NODE_EXE" "$NPM_CLI_JS" "$@" 38