mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2024-12-29 16:29:40 +00:00
0666f6482c
* Fixed ShellCheck.net warnings, including * exit -1: https://github.com/koalaman/shellcheck/wiki/SC2242 * cd || exit: https://github.com/koalaman/shellcheck/wiki/SC2164 * "$foo": https://github.com/koalaman/shellcheck/wiki/SC2086 * $(( $foo )): https://github.com/koalaman/shellcheck/wiki/SC2004 * grep | wc -l: https://github.com/koalaman/shellcheck/wiki/SC2126 * Use arrays instead of unquoted strings for loops and command arguments * Use (( ... )) arithmetic context instead of string comparisons * Use bash's built-in regex support instead of grep+sed+awk * Write errors to stderr
12 lines
511 B
Bash
Executable file
12 lines
511 B
Bash
Executable file
#!/bin/bash
|
|
|
|
lib_comment_lines=$(cat -- *.scad | grep -c '^// ')
|
|
tutorial_lines=$(cat tutorials/*.md | grep -c '^ *[^ /]')
|
|
|
|
printf '%-20s: %6d\n' \
|
|
'Documentation Lines' "$(( lib_comment_lines + tutorial_lines ))" \
|
|
'Example Code Lines' "$(cat examples/*.scad | grep -c '^ *[^ /]')" \
|
|
'Library Code Lines' "$(cat -- *.scad | grep -c '^ *[^ /]')" \
|
|
'Support Script Lines' "$(cat scripts/*.sh scripts/*.py | grep -c '^ *[^ /]')" \
|
|
'Test Code Lines' "$(cat tests/*.scad | grep -c '^ *[^ /]')"
|
|
|