Initial version of smartbooking generated by generator-jhipster@9.0.0-beta.0
This commit is contained in:
34
npmw
Executable file
34
npmw
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
|
||||
basedir=$(dirname "$0")
|
||||
|
||||
if [ -f "$basedir/gradlew" ]; then
|
||||
bindir="$basedir/build/node/bin"
|
||||
repodir="$basedir/build/node/lib/node_modules"
|
||||
installCommand="$basedir/gradlew npmSetup --no-daemon"
|
||||
else
|
||||
echo "Using npm installed globally"
|
||||
exec npm "$@"
|
||||
fi
|
||||
|
||||
NPM_EXE="$repodir/npm/bin/npm-cli.js"
|
||||
NODE_EXE="$bindir/node"
|
||||
|
||||
if [ ! -x "$NPM_EXE" ] || [ ! -x "$NODE_EXE" ]; then
|
||||
$installCommand || true
|
||||
fi
|
||||
|
||||
if [ -x "$NODE_EXE" ]; then
|
||||
echo "Using node installed locally $($NODE_EXE --version)"
|
||||
PATH="$bindir:$PATH"
|
||||
else
|
||||
NODE_EXE='node'
|
||||
fi
|
||||
|
||||
if [ ! -x "$NPM_EXE" ]; then
|
||||
echo "Local npm not found, using npm installed globally"
|
||||
npm "$@"
|
||||
else
|
||||
echo "Using npm installed locally $($NODE_EXE $NPM_EXE --version)"
|
||||
$NODE_EXE $NPM_EXE "$@"
|
||||
fi
|
||||
Reference in New Issue
Block a user