mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 06:37:46 +00:00
Create loc.nu
This commit is contained in:
parent
5a4027defe
commit
3e6f21dad9
1 changed files with 13 additions and 0 deletions
13
with_externals/loc.nu
Normal file
13
with_externals/loc.nu
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue