restructure, order imports
[mygpo.git] / bin / couchdb-view-usage.sh
blob1952b4355e4ae2a606f77cf33d4c45a0c89ef071
1 #!/bin/bash
3 DIR=`dirname $0`
4 cd $DIR/../mygpo
5 DIRS=`find . -type d -wholename "*/_design/views/*"`
7 for view in $DIRS; do
8 view_name=`echo $view | awk '{split($0,array,"/")} END{print array[2]"/"array[5]}'`
9 count=`git grep "$view_name" | wc -l`
10 if [ $count = "0" ]; then
11 echo -e -n "\e[00;31m"
13 echo $view_name $count | awk '{ printf "%-40s%-5s\n",$1,$2}'
14 echo -e -n '\e[00m'
15 done