Repository navigation
Port before_v0.60/cool_oneliners folder - #831
Merged
Merged
Conversation
added 2 commits
May 6, 2024 04:19
fdncred
reviewed
May 6, 2024
| @@ -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) | |||
Contributor
There was a problem hiding this comment.
why the change from ls -d to du --all?
Author
There was a problem hiding this comment.
Thanks for the catch. I got carried away a bit:) I have nu v0.44.0 and v0.32.0 and
- There is no
apparentcolumn inls -d - The command
help format filesizehas 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
added 11 commits
May 12, 2024 14:18
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
39555
force-pushed
the
port-before_v0.60/cool_oneliners
branch
from
May 12, 2024 12:51
7ef7611 to
8175f23
Compare
Author
|
A cleaner attempt this time with
|
Contributor
|
Thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is part of porting all old scripts #221 and ports
cool_onelinersfolderSummary
dict.nu
This script has already been ported to
sourced/cool_oneliners/dict.nuin28c7e09
file_cat.nu
has already been ported to
sourced/cool_oneliners/file_cat.nuin c47ccd4filesize.nu
js_map_to_markdown.nu
I created
sourced/cool-oneliners/assets/js_map.jsonwith 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