datasurvey/npmw

26 lines
509 B
Plaintext
Raw Permalink Normal View History

2021-07-03 21:48:27 +00:00
#!/bin/sh
basedir=`dirname "$0"`
if [ -f "$basedir/mvnw" ]; then
builddir="target/node"
installCommand="$basedir/mvnw frontend:install-node-and-npm@install-node-and-npm"
else
builddir=".gradle/npm"
installCommand="$basedir/gradlew npmSetup"
fi
NPM_EXE="$basedir/$builddir/npm"
if ! [ -x "$NPM_EXE" ]; then
$installCommand || true
fi
if ! [ -x "$NPM_EXE" ]; then
echo "Using npm installed globally"
npm "$@"
else
echo "Using npm installed locally $($NPM_EXE --version)"
$NPM_EXE "$@"
fi