mirror of
https://github.com/nushell/nu_scripts.git
synced 2024-09-19 17:57:10 +03:00
14 lines
344 B
Plaintext
14 lines
344 B
Plaintext
# This script requires that `tokei` be installed and available!
|
|
|
|
# Count lines of code in a project.
|
|
def "loc" [
|
|
...rest # args to pass to tokei
|
|
] {
|
|
tokei -o json $rest |
|
|
from json |
|
|
pivot |
|
|
rename lang lines |
|
|
insert files { get lines.reports | length } |
|
|
select lang files lines.code lines.comments lines.blanks
|
|
}
|