diff options
author | Yaco <franco@reevo.org> | 2020-06-04 11:01:00 -0300 |
---|---|---|
committer | Yaco <franco@reevo.org> | 2020-06-04 11:01:00 -0300 |
commit | fc7369835258467bf97eb64f184b93691f9a9fd5 (patch) | |
tree | daabd60089d2dd76d9f5fb416b005fbe159c799d /www/wiki/docs/kss/scripts/kss-node-check.sh |
first commit
Diffstat (limited to 'www/wiki/docs/kss/scripts/kss-node-check.sh')
-rwxr-xr-x | www/wiki/docs/kss/scripts/kss-node-check.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/www/wiki/docs/kss/scripts/kss-node-check.sh b/www/wiki/docs/kss/scripts/kss-node-check.sh new file mode 100755 index 00000000..84ee1c4e --- /dev/null +++ b/www/wiki/docs/kss/scripts/kss-node-check.sh @@ -0,0 +1,20 @@ +#!/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 |