Improve style on variant page; TODO: problems, Crazyhouse
[vchess.git] / countLines.sh
CommitLineData
73564bf6
BA
1#!/bin/bash
2# Count code lines ( using answer https://stackoverflow.com/a/965072 )
3
4function countFoldExt()
5{
6 count=0
7 for fullfile in `find $1`; do
8 filename=$(basename -- "$fullfile")
9 extension="${filename##*.}"
10 if [ "$extension" == "$2" ]; then
11 count=$((count+`wc -l $fullfile | grep -o ^[0-9]*`))
12 fi
13 done
14 echo $count
15}
16
17count=0
18count=$((count + $(countFoldExt "app.js" "js")))
19count=$((count + $(countFoldExt "gulpfile.js" "js")))
20count=$((count + $(countFoldExt "sockets.js" "js")))
21count=$((count + $(countFoldExt "bin" "www")))
22count=$((count + $(countFoldExt "db" "sql")))
23count=$((count + $(countFoldExt "public" "js")))
24count=$((count + $(countFoldExt "public" "sass")))
25count=$((count + $(countFoldExt "routes" "js")))
26count=$((count + $(countFoldExt "views" "pug")))
27echo $count