init-repo.sh 578 Bytes
Newer Older
nextime's avatar
nextime committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
#!/usr/bin/env bash
#
# Script to initialize angular repo
# - install required node packages
# - install Karma
# - install git hooks


node=`which node 2>&1`
if [ $? -ne 0 ]; then
  echo "Please install NodeJS."
  echo "http://nodejs.org/"
  exit 1
fi

npm=`which npm 2>&1`
if [ $? -ne 0 ]; then
  echo "Please install NPM."
fi


echo "Installing required npm packages..."
npm install

karma=`which karma 2>&1`
if [ $? -ne 0 ]; then
  echo "Installing Karma..."
  npm install -g karma
fi

echo "Installing git hooks..."
ln -sf ../../validate-commit-msg.js .git/hooks/commit-msg