kss-node-check.sh 677 B

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