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