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

Update make_readme_table.nu

This commit is contained in:
JT 2021-05-25 06:37:07 +12:00 committed by GitHub
parent faf4e624d8
commit 68e33fd1bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,27 +7,24 @@
# Right now there is still manual manipulation in order to update the README.md # Right now there is still manual manipulation in order to update the README.md
# Hopefully, in the future someone will contribute a script to make this automatic. # Hopefully, in the future someone will contribute a script to make this automatic.
let nu_files = $(ls **/*.nu) let nu_files = (ls **/*.nu)
let nu_table = $(echo $nu_files | let nu_table = ($nu_files |
get name | get name |
wrap File | wrap File |
insert 'Nu Version' 0.26 | insert 'Nu Version' 0.32 |
insert Description desc | insert Description desc |
insert Category { insert Category { |it|
let cat = $(get File | path dirname) let cat = ($it.File | path dirname)
if $cat == "" { if $cat == "" {
echo "not assigned yet" "not assigned yet"
} { } {
echo $cat $cat
} }
} | select Category File 'Nu Version' Description) } | select Category File 'Nu Version' Description)
# Let's fix the file now # Let's fix the file now
let nu_table = $(echo $nu_table | update File { let nu_table = ($nu_table | update File { |it|
let file_path = $(get File) let file_path = $it.File
let file_name = $(echo $file_path | path basename) let file_name = ($file_path | path basename)
let file_link = $(build-string "[" $file_name "]" "(./" $file_path ")") $"[($file_name)](char lparen)./($file_path)(char rparen)"
echo $file_link
}) })
$nu_table | to md --pretty
echo $nu_table | to md --pretty