-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port before_v0.60/cool_oneliners
folder
#831
Port before_v0.60/cool_oneliners
folder
#831
Conversation
sourced/cool-oneliners/filesize.nu
Outdated
@@ -0,0 +1,2 @@ | |||
## show file sizes in current directory starting from the largest | |||
print (du --all | sort-by apparent | reverse | format filesize KB apparent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the change from ls -d
to du --all
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the catch. I got carried away a bit:) I have nu v0.44.0
and v0.32.0
and
- There is no
apparent
column inls -d
- The command
help format filesize
has an exampledu | format filesize apparent B
- This script is about sizes
However I agree I should just porting and not rewriting so maybe I should simply change apparent
to size
and keep ls -d
1. `Dir` -> `dir` changed in `nushell/nushell` commit 837f0463ebe650d2ebbf16722cde011f8559be30 2. update signature for `format filesize` 3. there is no `apparent` column in `ls -d` ever in version `< `0.44`, I've changed it to `size`
- create `cool_oneliners/assets/js_map.json` for `open assets/js_map.json` - `$it` -> `$in` in the each closure - add `flatten` for make it from `[[Español English]; [...], [Español English]; [...]]` to `[[Español English]; [...] [...]]`
- make actually code, not just string - expand tabs to spaces - `Dir` -> `dir` - `each { if $it.type == Dir {echo $it.name} {} } ` -> `where type == dir` - remove empty `else` in `if {...} {}` - `echo` -> `print` - fix: expand `$element` to match with (pwd)
- mention `nu_plugin_inc` - full path in `ls` - explicit `$it` in the `each` closure - explicit <file> and `--force` in `save` for updating the destination - `to json --pretty` -> `to json --indent`
`from xml` in modern `nu` has different shape. Output is now a series of records with tag, attributes and content fields nushell/nushell#7947
7ef7611
to
8175f23
Compare
A cleaner attempt this time with
|
Thanks |
This PR is part of porting all old scripts #221 and ports
cool_oneliners
folderSummary
dict.nu
This script has already been ported to
sourced/cool_oneliners/dict.nu
in28c7e09
file_cat.nu
has already been ported to
sourced/cool_oneliners/file_cat.nu
in c47ccd4filesize.nu
js_map_to_markdown.nu
I created
sourced/cool-oneliners/assets/js_map.json
with the data for this script as it was beforecdpath-implementation.nu
parse_aws_s3_ls.nu
I don't have aws so I just ported the syntax
Edit: I considered not porting this script yet because I can't test it for now
npm_update_versions.nu
xml_search_schema.nu