This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # line_count of file as a single int | |
| def line_count [file] { | |
| let mt = (wc -l $file | split column --regex " " ) | |
| $mt | get 0 | get column0 | into int | |
| } | |
| def lc_type [ file_type] { | |
| let files = (glob $"**/*.($file_type)" --exclude ["target/**", "tmp/**"]) | |
| let lc = $files | each { line_count $in } | math sum | |
| {"file_count": ($files | length), "line_count": $lc } |