Partial revert I0d0ef26f59721039b2c24ab322fa3bf6ab16fea1
[lhc/web/wiklou.git] / docs / kss / scripts / kss-node-check.sh
1 #!/usr/bin/env bash
2
3 if command -v npm > /dev/null ; then
4 npm install
5 else
6 # If npm isn't installed, but kss-node is, exit normally.
7 # This allows setting it up on one machine, and running it on
8 # another (e.g. Tools Labs execution nodes) that doesn't have npm
9 # installed. However, "npm install" still needs to be run
10 # occasionally to keep kss updated.
11
12 KSS_NODE="${BASH_SOURCE%/*}/../node_modules/.bin/kss-node"
13 if ! [ -x "$KSS_NODE" ] ; then
14 echo "Neither kss-node nor npm are installed."
15 echo "To install npm, see http://nodejs.org/"
16 echo "When npm is installed, the Makefile can automatically"
17 echo "install kss-node."
18 exit 1
19 fi
20 fi