1
Fork 0
mirror of https://github.com/RGBCube/random-scripts synced 2025-05-14 19:14:58 +00:00

fix incredibly slow linearization

This commit is contained in:
RGBCube 2025-03-15 20:49:13 +03:00
parent 3d2b854882
commit 4c1dfb6f6e
No known key found for this signature in database

View file

@ -10,7 +10,7 @@ if (ls $root | is-not-empty) {
let source = input "enter directory to linearize: " let source = input "enter directory to linearize: "
ls ...(glob $"($source)/**/*") ls ...(glob --no-dir $"($source)/**/*")
| where type == file | where type == file
| group-by size | values | group-by size | values
| each {|group| | each {|group|
@ -25,7 +25,8 @@ ls ...(glob $"($source)/**/*")
$by_identity $by_identity
| filter { ($in | length) > 1 } | filter { ($in | length) > 1 }
| each {|entries| | each {|entries|
print $"found identical files: \n- (ansi red)($entries | get name | str join $'(ansi reset)\n- (ansi red)')(ansi reset)" let separator = $"(ansi reset)\n- (ansi red)"
print $"found identical files: \n- (ansi red)($entries | get name | str join $separator)(ansi reset)"
} }
$by_identity $by_identity