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=node 13fi 14 15NPM_CLI_JS="$basedir/node_modules/npm/bin/npm-cli.js" 16NPX_CLI_JS="$basedir/node_modules/npm/bin/npx-cli.js" 17 18case `uname` in 19 *MINGW*) 20 NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g` 21 NPM_PREFIX_NPX_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npx-cli.js" 22 if [ -f "$NPM_PREFIX_NPX_CLI_JS" ]; then 23 NPX_CLI_JS="$NPM_PREFIX_NPX_CLI_JS" 24 fi 25 ;; 26 *CYGWIN*) 27 NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g` 28 NPM_PREFIX_NPX_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npx-cli.js" 29 if [ -f "$NPM_PREFIX_NPX_CLI_JS" ]; then 30 NPX_CLI_JS="$NPM_PREFIX_NPX_CLI_JS" 31 fi 32 ;; 33esac 34 35"$NODE_EXE" "$NPX_CLI_JS" "$@" 36