2 # Count code lines ( using answer https://stackoverflow.com/a/965072 )
4 function countFoldExt
()
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]*`))
18 count
=$((count + $(countFoldExt "app.js" "js")))
19 count
=$((count + $(countFoldExt "gulpfile.js" "js")))
20 count
=$((count + $(countFoldExt "sockets.js" "js")))
21 count
=$((count + $(countFoldExt "bin" "www")))
22 count
=$((count + $(countFoldExt "config" "js")))
23 count
=$((count + $(countFoldExt "db" "sql")))
24 count
=$((count + $(countFoldExt "models" "js")))
25 count
=$((count + $(countFoldExt "public" "js")))
26 count
=$((count + $(countFoldExt "public" "sass")))
27 count
=$((count + $(countFoldExt "routes" "js")))
28 count
=$((count + $(countFoldExt "utils" "js")))
29 count
=$((count + $(countFoldExt "views" "pug")))