wiki.techinc.nl/docs/kss/scripts/kss-node-check.sh
Matthew Flaschen ed420133a2 LSG: Allow the style guide to build without npm present at runtime
By only requiring the actual kss-node executable, this allows
running "npm install" at a separate time/machine from the actual
build.

For example, this is useful since the machines used to run Tool Labs
grid jobs do not have npm.

Change-Id: I561b365d4aaf44d921fb54a020e9ff6319318063
2014-08-06 18:29:53 +00:00

20 lines
677 B
Bash
Executable file

#!/usr/bin/env bash
if command -v npm > /dev/null ; then
npm install
else
# If npm isn't installed, but kss-node is, exit normally.
# This allows setting it up on one machine, and running it on
# another (e.g. Tools Labs execution nodes) that doesn't have npm
# installed. However, "npm install" still needs to be run
# occasionally to keep kss updated.
KSS_NODE="${BASH_SOURCE%/*}/../node_modules/.bin/kss-node"
if ! [ -x "$KSS_NODE" ] ; then
echo "Neither kss-node nor npm are installed."
echo "To install npm, see http://nodejs.org/"
echo "When npm is installed, the Makefile can automatically"
echo "install kss-node."
exit 1
fi
fi