Draft Game and Challenge models
[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")))
8ef618ef 22count=$((count + $(countFoldExt "config" "js")))
73564bf6 23count=$((count + $(countFoldExt "db" "sql")))
8ef618ef 24count=$((count + $(countFoldExt "models" "js")))
73564bf6
BA
25count=$((count + $(countFoldExt "public" "js")))
26count=$((count + $(countFoldExt "public" "sass")))
27count=$((count + $(countFoldExt "routes" "js")))
8ef618ef 28count=$((count + $(countFoldExt "utils" "js")))
73564bf6
BA
29count=$((count + $(countFoldExt "views" "pug")))
30echo $count