1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 06:37:46 +00:00

Merge pull request #76 from zkat/patch-1

Add loc.nu
This commit is contained in:
Darren Schroeder 2021-07-25 16:47:14 -05:00 committed by GitHub
commit d1db74d21f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

13
with_externals/loc.nu Normal file
View file

@ -0,0 +1,13 @@
# 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
}