1
2
3
4
5
6
7
8
9
#!/bin/sh
 
logs="grep -iR 'console\.log' --exclude-dir=node_modules --exclude-dir=client/vendor --exclude-dir=server/views --exclude-dir=tests --exclude-dir=script --exclude='server/server.js' --exclude='*.un~' --exclude='api/server.js' *"
count=`eval "$logs | wc -l | awk '{print $1}'"`
if [[ "$count" -ge 1 ]]; then 
  echo "\033[0;31mRemove stray console.log() statements:\033[0m"
  eval $logs
  exit 1
fi