diff --git a/api_wrappers/wolframalpha.nu b/api_wrappers/wolframalpha.nu index 5383c7ed..45b0245c 100644 --- a/api_wrappers/wolframalpha.nu +++ b/api_wrappers/wolframalpha.nu @@ -2,7 +2,7 @@ def wolfram [...query #Your query ] { let appID = #YOUR APP_ID - let query_string = ($query | str collect " ") + let query_string = ($query | str join " ") let result = (fetch ("https://api.wolframalpha.com/v1/result?" + ([[appid i]; [$appID $query_string]] | to url))) $result + "" } @@ -11,9 +11,9 @@ def wolfram [...query #Your query def wolframimg [...query #Your query ] { let appID = #YOUR APP_ID - let query_string = ($query | str collect " ") + let query_string = ($query | str join " ") let filename = ($query_string + ".png") let link = ("https://api.wolframalpha.com/v1/simple?" + ([[appid i]; [$appID $query_string]] | to url) + "&background=F5F5F5&fontsize=20") fetch $link | save $filename echo ("Query result saved in file: " + $filename) -} +} diff --git a/aws/select-aws-profile.nu b/aws/select-aws-profile.nu index b520ee39..ac3f452a 100644 --- a/aws/select-aws-profile.nu +++ b/aws/select-aws-profile.nu @@ -14,7 +14,7 @@ export alias select-aws-profile = ( hide AWS_REGION; (do { let creds = (open ($env.HOME + "/.aws/credentials") | from ini) - let selectedProfile = (for it in ($creds | transpose name creds) { echo $it.name } | str collect "\n" | fzf | str trim) + let selectedProfile = (for it in ($creds | transpose name creds) { echo $it.name } | str join "\n" | fzf | str trim) if $selectedProfile != "" { let out = { AWS_PROFILE: $selectedProfile, diff --git a/benchmarks/gradient-autoview.nu b/benchmarks/gradient-autoview.nu index 37692cd7..c4105268 100644 --- a/benchmarks/gradient-autoview.nu +++ b/benchmarks/gradient-autoview.nu @@ -14,7 +14,7 @@ seq 0 $height | par-each {|| # create these in parallel } else { $"(ansi -e '48;2;0;0;')($fgcolor)m (ansi -e '0m')" } - } | str collect) + } | str join) print -n $"($row_data)" | table $nothing } | compact diff --git a/benchmarks/gradient.nu b/benchmarks/gradient.nu index babdbeea..8ee5fc00 100644 --- a/benchmarks/gradient.nu +++ b/benchmarks/gradient.nu @@ -14,9 +14,9 @@ seq 0 $height | each { |row| } else { $"(ansi -e '48;2;0;0;')($fgcolor)m(char sp)(ansi -e '0m')" } - } | str collect) + } | str join) print -n $"($row_data)(char newline)" -} | str collect +} | str join def iter_inc [incr mult iter] { $incr + $mult * $iter diff --git a/benchmarks/gradient_benchmark.nu b/benchmarks/gradient_benchmark.nu index b80c7506..2e7a06e2 100644 --- a/benchmarks/gradient_benchmark.nu +++ b/benchmarks/gradient_benchmark.nu @@ -22,9 +22,9 @@ if ($is_release | str downcase | str trim) == "y" { } else { $"(ansi -e '48;2;0;0;')($fgcolor)m(char sp)(ansi -e '0m')" } - } | str collect) + } | str join) $"($row_data)(char newline)" - } | str collect + } | str join } | math avg) @@ -42,9 +42,9 @@ if ($is_release | str downcase | str trim) == "y" { } else { $"(ansi -e '48;2;0;0;')($fgcolor)m(char sp)(ansi -e '0m')" } - } | str collect) + } | str join) $"($row_data)(char cr)" - } | str collect + } | str join } | math avg) print $"running test 2 at (date now | date format '%Y-%m-%d %H:%M:%S.%3f')" @@ -61,9 +61,9 @@ if ($is_release | str downcase | str trim) == "y" { } else { $"(ansi -e '48;2;0;0;')($fgcolor)m (ansi -e '0m')" } - } | str collect) + } | str join) $"($row_data)(char cr)" - } | str collect + } | str join } | math avg) print $"running test 3 at (date now | date format '%Y-%m-%d %H:%M:%S.%3f')" @@ -82,9 +82,9 @@ if ($is_release | str downcase | str trim) == "y" { } else { $"($ansi1)($fgcolor)m(char sp)($ansi2)" } - } | str collect) + } | str join) $"($row_data)(char cr)" - } | str collect + } | str join } | math avg) print $"running test 4 at (date now | date format '%Y-%m-%d %H:%M:%S.%3f')" @@ -101,9 +101,9 @@ if ($is_release | str downcase | str trim) == "y" { } else { $"(ansi -e '48;2;0;0;')($fgcolor)m(char sp)(ansi -e '0m')" } - } | str collect) + } | str join) $"($row_data)(char cr)" - } | str collect + } | str join } | math avg) print $"running test 5 at (date now | date format '%Y-%m-%d %H:%M:%S.%3f')" @@ -120,9 +120,9 @@ if ($is_release | str downcase | str trim) == "y" { } else { $"(ansi -e '48;2;0;0;')($fgcolor)m (ansi -e '0m')" } - } | str collect) + } | str join) $"($row_data)(char cr)" - } | str collect + } | str join } | math avg) print $"running test 6 at (date now | date format '%Y-%m-%d %H:%M:%S.%3f')" @@ -139,9 +139,9 @@ if ($is_release | str downcase | str trim) == "y" { } else { $"(ansi -e '48;2;0;0;')($fgcolor)m (ansi -e '0m')" } - } | str collect) + } | str join) $"($row_data)(char cr)" - } | str collect + } | str join } | math avg) print 'collating tests' diff --git a/benchmarks/gradient_benchmark_no_check.nu b/benchmarks/gradient_benchmark_no_check.nu index 392b85eb..3a484c2d 100644 --- a/benchmarks/gradient_benchmark_no_check.nu +++ b/benchmarks/gradient_benchmark_no_check.nu @@ -23,9 +23,9 @@ if ($is_release | str downcase | str trim) == "y" { } else { $"(ansi -e '48;2;0;0;')($fgcolor)m(char sp)(ansi -e '0m')" } - } | str collect) + } | str join) $"($row_data)(char newline)" - } | str collect + } | str join } | math avg) @@ -43,9 +43,9 @@ if ($is_release | str downcase | str trim) == "y" { } else { $"(ansi -e '48;2;0;0;')($fgcolor)m(char sp)(ansi -e '0m')" } - } | str collect) + } | str join) $"($row_data)(char cr)" - } | str collect + } | str join } | math avg) print $"running test 2 at (date now | date format '%Y-%m-%d %H:%M:%S.%3f')" @@ -62,9 +62,9 @@ if ($is_release | str downcase | str trim) == "y" { } else { $"(ansi -e '48;2;0;0;')($fgcolor)m (ansi -e '0m')" } - } | str collect) + } | str join) $"($row_data)(char cr)" - } | str collect + } | str join } | math avg) print $"running test 3 at (date now | date format '%Y-%m-%d %H:%M:%S.%3f')" @@ -83,9 +83,9 @@ if ($is_release | str downcase | str trim) == "y" { } else { $"($ansi1)($fgcolor)m(char sp)($ansi2)" } - } | str collect) + } | str join) $"($row_data)(char cr)" - } | str collect + } | str join } | math avg) print $"running test 4 at (date now | date format '%Y-%m-%d %H:%M:%S.%3f')" @@ -102,9 +102,9 @@ if ($is_release | str downcase | str trim) == "y" { } else { $"(ansi -e '48;2;0;0;')($fgcolor)m(char sp)(ansi -e '0m')" } - } | str collect) + } | str join) $"($row_data)(char cr)" - } | str collect + } | str join } | math avg) print $"running test 5 at (date now | date format '%Y-%m-%d %H:%M:%S.%3f')" @@ -121,9 +121,9 @@ if ($is_release | str downcase | str trim) == "y" { } else { $"(ansi -e '48;2;0;0;')($fgcolor)m (ansi -e '0m')" } - } | str collect) + } | str join) $"($row_data)(char cr)" - } | str collect + } | str join } | math avg) print $"running test 6 at (date now | date format '%Y-%m-%d %H:%M:%S.%3f')" @@ -140,9 +140,9 @@ if ($is_release | str downcase | str trim) == "y" { } else { $"(ansi -e '48;2;0;0;')($fgcolor)m (ansi -e '0m')" } - } | str collect) + } | str join) $"($row_data)(char cr)" - } | str collect + } | str join } | math avg) print 'collating tests' diff --git a/coloring/24bit-1.nu b/coloring/24bit-1.nu index 294f6cb2..b99a8ad0 100644 --- a/coloring/24bit-1.nu +++ b/coloring/24bit-1.nu @@ -12,7 +12,7 @@ export def draw [] { } else { build-colorstr $r $g $b $col } - } | str collect + } | str join } def build-colorstr [ diff --git a/coloring/256_color_testpattern.nu b/coloring/256_color_testpattern.nu index 3e484b6e..88827eac 100644 --- a/coloring/256_color_testpattern.nu +++ b/coloring/256_color_testpattern.nu @@ -47,7 +47,7 @@ def print_run [start:int, amount:int] { } else { "" } - } | append " " | str collect + } | append " " | str join } def print_blocks [start:int, end:int, block_cols:int, block_rows:int, blocks_per_line:int] { @@ -57,9 +57,9 @@ def print_blocks [start:int, end:int, block_cols:int, block_rows:int, blocks_per 0..<$block_rows | each { |row| 0..<$blocks_per_line | each { |block| print_run ($start + $block * $block_length + $row * $block_cols + $i * $block_length * $blocks_per_line) $block_cols - } | append (char nl) | str collect - } | str collect - } | str collect + } | append (char nl) | str join + } | str join + } | str join } print (print_run 0 16) # The first 16 colours are spread over the whole spectrum diff --git a/cool-oneliners/dict.nu b/cool-oneliners/dict.nu index fa0cba70..c11b109e 100644 --- a/cool-oneliners/dict.nu +++ b/cool-oneliners/dict.nu @@ -1,10 +1,10 @@ # Function querying free online English dictionary API for definition of given word(s) def dict [...word #word(s) to query the dictionary API but they have to make sense together like "martial law", not "cats dogs" ] { - let query = ($word | str collect %20) + let query = ($word | str join %20) let link = ('https://api.dictionaryapi.dev/api/v2/entries/en/' + ($query|str replace ' ' '%20')) let output = (fetch $link | rename word) - let w = ($output.word | first) + let w = ($output.word | first) if $w == "No Definitions Found" { echo $output.word diff --git a/custom-completions/auto-generate/parse-fish.nu b/custom-completions/auto-generate/parse-fish.nu index 972ef370..f32be002 100644 --- a/custom-completions/auto-generate/parse-fish.nu +++ b/custom-completions/auto-generate/parse-fish.nu @@ -13,7 +13,7 @@ def build-completions-from-pwd [] { # build a completion form a .fish file and generate a .nu file def build-completion [fish_file: path, nu_file: path] { - open $fish_file | parse-fish | make-commands-completion | str collect "\n\n" | save $nu_file + open $fish_file | parse-fish | make-commands-completion | str join "\n\n" | save $nu_file } # parse a .fish file based on autogenerated complete syntax @@ -97,7 +97,7 @@ def make-subcommands-completion [parents: list] { build-string ( if ('d' in ($subcommand.args | columns)) and ($subcommand.args.d != "") { build-string "# " ($subcommand.args.d.0) "\n" # (sub)command description - }) "extern " $quote ($parents | str collect " ") ( + }) "extern " $quote ($parents | str join " ") ( if $subcommand.name != "" { build-string " " $subcommand.name # sub command if present }) $quote " [\n" ( @@ -112,7 +112,7 @@ def make-subcommands-completion [parents: list] { $fishes # catch all } | build-flags - | str collect "\n" + | str join "\n" ) "\n\t...args\n]" } } diff --git a/custom-completions/auto-generate/parse-help.nu b/custom-completions/auto-generate/parse-help.nu index 053459f5..d8c3bee3 100644 --- a/custom-completions/auto-generate/parse-help.nu +++ b/custom-completions/auto-generate/parse-help.nu @@ -14,7 +14,7 @@ def make-completion [command_name: string] { }) (if ($it.description | is-empty) == false { build-string "\t\t# " $it.description }) - } | str collect "\n") "\n\t...args\n]" + } | str join "\n") "\n\t...args\n]" } module tests { diff --git a/custom-completions/scoop/scoop-completions.nu b/custom-completions/scoop/scoop-completions.nu index 11394d04..9c0113b7 100644 --- a/custom-completions/scoop/scoop-completions.nu +++ b/custom-completions/scoop/scoop-completions.nu @@ -33,7 +33,7 @@ def scoopInstalledAppsWithStar [] { # list of all manifests from all buckets def scoopAllApps [] { let bucketsDir = if ('SCOOP' in (env).name) { [ (getenv 'SCOOP'), 'buckets' ] | path join } else { [ (getenv 'USERPROFILE'), 'scoop', 'buckets' ] | path join } - (ls -s $bucketsDir | get name) | each {|bucket| ls ([$bucketsDir, $bucket, 'bucket', '*.json'] | str collect '\') | get name | path basename | str substring ',-5' } | flatten | uniq + (ls -s $bucketsDir | get name) | each {|bucket| ls ([$bucketsDir, $bucket, 'bucket', '*.json'] | str join '\') | get name | path basename | str substring ',-5' } | flatten | uniq } # list of all apps that are not installed diff --git a/custom-completions/winget/winget-completions.nu b/custom-completions/winget/winget-completions.nu index e19769c6..5021e0d7 100644 --- a/custom-completions/winget/winget-completions.nu +++ b/custom-completions/winget/winget-completions.nu @@ -79,7 +79,7 @@ def "winget show" [ (do $flagify header $header) (do $flagify accept_source_agreements $accept_source_agreements) (do $flagify help $help) - ] | str collect ' ') + ] | str join ' ') if $raw or $help { ^$command @@ -92,7 +92,7 @@ def "winget show" [ $"(ansi yellow)($output | first | str trim)(ansi reset)" } else { let header = ($output | first | parse -r 'Found (?P.+) \[(?P.+)\]') - let manifest = ($output | skip 1 | str collect (char newline) | from yaml) + let manifest = ($output | skip 1 | str join (char newline) | from yaml) $header | first | merge { $manifest } } } @@ -127,7 +127,7 @@ def "winget source list" [ $pos_name (do $flagify name $name) (do $flagify help $help) - ] | str collect ' ') + ] | str join ' ') if $raw or $help { ^$command @@ -200,7 +200,7 @@ def "winget search" [ (do $flagify header $header) (do $flagify accept_source_agreements $accept_source_agreements) (do $flagify help $help) - ] | str collect ' ') + ] | str join ' ') if $raw or $help { ^$command @@ -248,7 +248,7 @@ def "winget list" [ (do $flagify header $header) (do $flagify accept_source_agreements $accept_source_agreements) (do $flagify help $help) - ] | str collect ' ') + ] | str join ' ') if $help or $raw { ^$command @@ -446,27 +446,27 @@ def "nu-complete winget parse table" [lines: any] { let version = if $lengths.version > 0 { ( $it | skip ($lengths.name + $lengths.id) - | first $lengths.version | str collect | str trim + | first $lengths.version | str join | str trim ) } else { "" } let available = if $lengths.available > 0 { ( $it | skip ($lengths.name + $lengths.id + $lengths.version) - | first $lengths.available | str collect | str trim + | first $lengths.available | str join | str trim ) } else { "" } let source = if $lengths.source > 0 { ( $it | skip ($lengths.name + $lengths.id + $lengths.version + $lengths.available) - | str collect | str trim + | str join | str trim ) } else { "" } { - name: ($it | first $lengths.name | str collect | str trim), - id: ($it | skip $lengths.name | first $lengths.id | str collect | str trim), + name: ($it | first $lengths.name | str join | str trim), + id: ($it | skip $lengths.name | first $lengths.id | str join | str trim), version: $version, available: $available, source: $source diff --git a/example-config/init.nu b/example-config/init.nu index 704c3f78..54b2b7ba 100644 --- a/example-config/init.nu +++ b/example-config/init.nu @@ -15,7 +15,7 @@ export env LS_COLORS { "mi=00;40;31" "ln=00;36" "ex=00;32" - ] | str collect (char env_sep) + ] | str join (char env_sep) } export env BROWSER { "firefox" } export env CARGO_TARGET_DIR { "~/.cargo/target" } @@ -36,7 +36,7 @@ export def build-prompt [] { '@' $env.HOSTNAME ':' - ] | str collect + ] | str join } else { '' }) @@ -47,5 +47,5 @@ export def build-prompt [] { pwd }) - [ $usr_str $pwd_str ' ' ] | str collect + [ $usr_str $pwd_str ' ' ] | str join } diff --git a/formatting/number-format.nu b/formatting/number-format.nu index 8c289104..cd6b7479 100644 --- a/formatting/number-format.nu +++ b/formatting/number-format.nu @@ -35,7 +35,7 @@ def number-format [ } else { $whole_part } - | str collect '' + | str join '' ) let whole_part3 = ( diff --git a/fun/spark.nu b/fun/spark.nu index 1b48e0f3..55ed83b6 100644 --- a/fun/spark.nu +++ b/fun/spark.nu @@ -1,10 +1,10 @@ -let TICKS = [(char -u "2581") - (char -u "2582") - (char -u "2583") - (char -u "2584") - (char -u "2585") - (char -u "2586") - (char -u "2587") +let TICKS = [(char -u "2581") + (char -u "2582") + (char -u "2583") + (char -u "2584") + (char -u "2585") + (char -u "2586") + (char -u "2587") (char -u "2588")] # send an array into spark and get a sparkline out @@ -20,7 +20,7 @@ def spark [v: list] { $v | each { |e| let i = ((($e - $min) * $ratio) | math round) $"($TICKS | get $i)" - } | str collect + } | str join } def assert_eq [num: int, expected: string, input: list] { @@ -28,10 +28,10 @@ def assert_eq [num: int, expected: string, input: list] { let span = (metadata $expected).span; if $actual != $expected { error make { - msg: "Actual != Expected", + msg: "Actual != Expected", label: { - text: $"expected ($expected) but got ($actual)", start: $span.start, end: $span.end - } + text: $"expected ($expected) but got ($actual)", start: $span.start, end: $span.end + } } } else { print $"Test ($num) (ansi green)passed(ansi reset) ✓" diff --git a/fun/website_builder.nu b/fun/website_builder.nu index e938aec4..8c46b1c5 100644 --- a/fun/website_builder.nu +++ b/fun/website_builder.nu @@ -12,7 +12,7 @@ for $markdown in $markdown_files { let $header = ($content_lines | skip 1 | take while {|x| ($x | str trim) != "---"} - | str collect "\n" + | str join "\n" | from yaml) let $post = ($content_lines @@ -45,7 +45,7 @@ for $markdown in $markdown_files { } }) - let $html_post = ($html_post | str collect "\n") + let $html_post = ($html_post | str join "\n") let $html_post = $" diff --git a/gitlab/gitlab.nu b/gitlab/gitlab.nu index 61a3d2bb..8d3573c9 100755 --- a/gitlab/gitlab.nu +++ b/gitlab/gitlab.nu @@ -7,7 +7,7 @@ def call-gitlab [ ...args: string --query: string ] { - fetch -H [Authorization $"Bearer ($env.GITLAB_TOKEN)"] $"($projects)($args|str collect)?($query)" + fetch -H [Authorization $"Bearer ($env.GITLAB_TOKEN)"] $"($projects)($args|str join)?($query)" } # Search files on your GitLab server def main [ diff --git a/helpers/update_hosts.nu b/helpers/update_hosts.nu index a3818b89..a9b2ce39 100644 --- a/helpers/update_hosts.nu +++ b/helpers/update_hosts.nu @@ -23,7 +23,7 @@ module hosts { let WHITELIST = ["multipasko"] let BLACKLIST = ["0.0.0.0 tiktok.com"] - let whitelisted = "(" + ($WHITELIST | str collect "|") + ")" + let whitelisted = "(" + ($WHITELIST | str join "|") + ")" let pattern = ($"0.0.0.0.*($whitelisted).*$") let OLD_FILE = "/etc/hosts" let TMP_FILE = (fetch $LINK | lines) @@ -51,13 +51,13 @@ module hosts { echo "Done!" } else { error make -u {msg: "Something went wrong while overwriting the /etc/hosts file"} - } - } + } + } } else { echo "No updates available." } } else { error make -u {msg: "Failed downloading the hosts file, try again."} - } + } } } diff --git a/make_release/gen-js-ext.nu b/make_release/gen-js-ext.nu index 825ebefb..eb4fa309 100644 --- a/make_release/gen-js-ext.nu +++ b/make_release/gen-js-ext.nu @@ -5,7 +5,7 @@ def gen_keywords [] { and category !~ deprecated and ($it.command | str contains -n ' ') | get command - | str collect '|') + | str join '|') let var_with_dash_or_under_regex = '(([a-zA-Z]+[\\-_]){1,}[a-zA-Z]+\\s)' let preamble = '\\b(' @@ -30,7 +30,7 @@ def gen_sub_keywords [] { let cmds = (for x in $sub_cmds { let parts = ($x | split row ' ') $'($parts.0)\\s($parts.1)' - } | str collect '|') + } | str join '|') $'"match": "($preamble)($cmds)($postamble)",' } $"Generating sub keywords(char nl)" @@ -57,11 +57,11 @@ def gen_keywords_alphabetically [] { } else { $nothing } - } | str collect '|') + } | str join '|') if ($letter_cmds | str trim | str length) > 0 { $'"match": "($preamble)($letter_cmds)($postamble)",' } - } | str collect "\n" + } | str join "\n" } "Generating keywords alphabetically\n" @@ -89,11 +89,11 @@ def gen_sub_keywords_alphabetically [] { } else { $nothing } - } | str collect '|') + } | str join '|') if ($letter_cmds | str trim | str length) > 0 { $'"match": "($preamble)($letter_cmds)($postamble)",' } - } | str collect "\n" + } | str join "\n" } "Generating sub keywords alphabetically\n" diff --git a/maths/math_functions.nu b/maths/math_functions.nu index 1352f20b..b85c478c 100644 --- a/maths/math_functions.nu +++ b/maths/math_functions.nu @@ -132,7 +132,7 @@ export def dec2base [ } else { let newNumber = (($number - ($number mod $base)) / $base) - [(dec2base $newNumber $base) ($chars | get ($number mod $base))] | str collect + [(dec2base $newNumber $base) ($chars | get ($number mod $base))] | str join } } diff --git a/misc/nu_defs.nu b/misc/nu_defs.nu index 5891f423..b276496b 100644 --- a/misc/nu_defs.nu +++ b/misc/nu_defs.nu @@ -138,7 +138,7 @@ def-env which-cd [program] { def git-push [m: string] { git add -A git status - git commit -am $"($m)" + git commit -a -m $"($m)" git push origin main } @@ -149,7 +149,7 @@ def "help my-commands" [] { #web search in terminal (requires ddgr) def gg [...search: string] { - ddgr -n 5 ($search | str collect ' ') + ddgr -n 5 ($search | str join ' ') } #habitipy dailies done all (requires habitipy) @@ -341,7 +341,7 @@ def trans [ let from = if ($from | is-empty) {"en-US"} else {$from} let to = if ($to | is-empty) {"es-ES"} else {$to} - let to_translate = ($search | str collect "%20") + let to_translate = ($search | str join "%20") let url = $"https://api.mymemory.translated.net/get?q=($to_translate)&langpair=($from)%7C($to)&of=json&key=($key)&de=($user)" @@ -434,7 +434,7 @@ def skim [ let lst = $in let type = ($lst | describe) let s = (if ($type | str starts-with 'list<') { - $lst | str collect (char nl) + $lst | str join (char nl) } else if ($type == 'string') { $lst }) diff --git a/network/remoting/remoting.nu b/network/remoting/remoting.nu index 1235e839..7ef7733d 100644 --- a/network/remoting/remoting.nu +++ b/network/remoting/remoting.nu @@ -46,7 +46,7 @@ export def ssh [ let host = (hosts|where name == $hostname|get -i 0) if ($host.nu) { if ($args|length) > 0 { - ^ssh (get-url $host) (build-string ($args|str collect ' ') '|to json -r')|from json + ^ssh (get-url $host) (build-string ($args|str join ' ') '|to json -r')|from json } else { ^ssh (get-url $host) } @@ -65,7 +65,7 @@ export def "ssh script" [ if $script in ($nu.scope.commands|where is_custom|get command) { let host = (hosts|where name == $hostname|get 0) - let full_command = (build-string (view-source $script) '; ' $script ' ' ($args|str collect ' ') '|to json -r') + let full_command = (build-string (view-source $script) '; ' $script ' ' ($args|str join ' ') '|to json -r') ^ssh (get-url $host) ($full_command)|from json } else { diff --git a/prompt/async_git_prompt/prompt.nu b/prompt/async_git_prompt/prompt.nu index 23bde356..8802f401 100644 --- a/prompt/async_git_prompt/prompt.nu +++ b/prompt/async_git_prompt/prompt.nu @@ -5,7 +5,7 @@ def prompt-concat [parts: table] { $parts | where (not ($it.text | is-empty)) | each { |it| $"($it.color)($it.text)" } - | str collect ' ' + | str join ' ' } def prompt-git-branch [] { diff --git a/prompt/oh-my-minimal.nu b/prompt/oh-my-minimal.nu index 8f7a3c03..e05c3cf2 100644 --- a/prompt/oh-my-minimal.nu +++ b/prompt/oh-my-minimal.nu @@ -58,7 +58,7 @@ export def path_abbrev_if_needed [apath term_width] { let tokens = ($tokens | append $"($PB)($splits | last)($R)") # collect - $tokens | str collect $"($T)/" + $tokens | str join $"($T)/" } else { if ($splits_len == 0) { # We're at / on the file system @@ -66,7 +66,7 @@ export def path_abbrev_if_needed [apath term_width] { } else if ($splits_len == 1) { let top_part = ($splits | first) let tokens = $"($PB)($top_part)($R)" - $tokens | str collect $"($T)" + $tokens | str join $"($T)" } else { let top_part = ($splits | first ($splits_len - 1)) let end_part = ($splits | last) @@ -74,7 +74,7 @@ export def path_abbrev_if_needed [apath term_width] { $"/($T)($x | str substring 0,1)($R)" }) let tokens = ($tokens | append $"/($PB)($end_part)($R)") - $tokens | skip 1 | str collect $"($T)" + $tokens | skip 1 | str join $"($T)" } } } @@ -142,7 +142,7 @@ export def get_left_prompt [os use_nerd_fonts] { $right_transition }) (char space) # space - ] | str collect) + ] | str join) let is_home_in_path = ($env.PWD | str starts-with $nu.home-path) let path_segment = (if $is_home_in_path { @@ -156,7 +156,7 @@ export def get_left_prompt [os use_nerd_fonts] { $display_path # ~/src/forks/nushell (ansi { fg: "#CED7CF" bg: "#3465A4"}) # color just to color the next space (char space) # space - ] | str collect + ] | str join } else { [ (if $use_nerd_fonts { @@ -168,7 +168,7 @@ export def get_left_prompt [os use_nerd_fonts] { $display_path # ~/src/forks/nushell (ansi { fg: "#CED7CF" bg: "#3465A4"}) # color just to color the next space (char space) # space - ] | str collect + ] | str join }) let indicator_segment = ( @@ -181,7 +181,7 @@ export def get_left_prompt [os use_nerd_fonts] { " >" }) ($R) # reset color - ] | str collect + ] | str join ) # assemble all segments for final prompt printing @@ -189,7 +189,7 @@ export def get_left_prompt [os use_nerd_fonts] { $os_segment $path_segment $indicator_segment - ] | str collect + ] | str join } export def get_right_prompt [os use_nerd_fonts] { @@ -220,7 +220,7 @@ export def get_right_prompt [os use_nerd_fonts] { (date now | date format '%m/%d/%Y %I:%M:%S%.3f') (char space) ($R) - ] | str collect) + ] | str join) let time_segment = ([ (ansi { fg: $TIME_BG bg: $TERM_FG}) @@ -234,7 +234,7 @@ export def get_right_prompt [os use_nerd_fonts] { (date now | date format '%I:%M:%S %p') (char space) ($R) - ] | str collect) + ] | str join) # 1. datetime - working # $datetime_segment @@ -249,7 +249,7 @@ export def get_right_prompt [os use_nerd_fonts] { # [ # $git_segment # $time_segment - # ] | str collect + # ] | str join # 5. fernando wants this on the left prompt # [ diff --git a/prompt/oh-my-v2.nu b/prompt/oh-my-v2.nu index ac6c7ebf..53b3ee21 100644 --- a/prompt/oh-my-v2.nu +++ b/prompt/oh-my-v2.nu @@ -287,7 +287,7 @@ def get_os_segment [os color_mode] { ($transition_bg_color) ($transition_icon) (char space) - ] | str collect + ] | str join ) $os_segment @@ -308,7 +308,7 @@ def get_path_segment [os color_mode] { ($pwd_color) ($pwd_bg_color) (char space) # space - ] | str collect + ] | str join ) $path_segment @@ -325,7 +325,7 @@ def get_indicator_segment [os color_mode] { ($indicator_bg_color) (char nf_segment) #  ($R) # reset color - ] | str collect + ] | str join ) $indicator_segment @@ -344,7 +344,7 @@ def get_time_segment [os color_mode] { let R = (ansi reset) let time_bg_color = (get_color time_bg_color $color_mode) let time_color = (get_color time_color $color_mode) - + let time_segment = ([ (ansi { fg: $time_bg_color bg: $time_color}) (char nf_right_segment) #(char -u e0b2) #  @@ -354,7 +354,7 @@ def get_time_segment [os color_mode] { (date now | date format '%I:%M:%S %p') (char space) ($R) - ] | str collect) + ] | str join) $time_segment } @@ -381,7 +381,7 @@ def get_status_segment [os color_mode] { $env.LAST_EXIT_CODE (char space) ($R) - ] | str collect + ] | str join ) $status_segment @@ -403,7 +403,7 @@ def get_execution_time_segment [os color_mode] { $env.CMD_DURATION_MS (char space) ($R) - ] | str collect + ] | str join ) $execution_time_segment @@ -415,7 +415,7 @@ def get_right_prompt [os color_mode] { let execution_time_segment = (get_execution_time_segment $os $color_mode) let time_segment = (get_time_segment $os $color_mode) let exit_if = (if $env.LAST_EXIT_CODE != 0 { $status_segment }) - [$exit_if $execution_time_segment $time_segment] | str collect + [$exit_if $execution_time_segment $time_segment] | str join } # constructe the left and right prompt by color_mode (8bit or 24bit) diff --git a/prompt/shell_space.nu b/prompt/shell_space.nu index 7a810cec..2e1ba6b9 100644 --- a/prompt/shell_space.nu +++ b/prompt/shell_space.nu @@ -4,9 +4,9 @@ def workspaces [] { if $item.active { $"(ansi green)($index) " } else { - $"(ansi blue)($index) " + $"(ansi blue)($index) " } - }| str collect + }| str join } def create_right_prompt [] { @@ -14,7 +14,7 @@ def create_right_prompt [] { (date now | date format '%r'), " ", (workspaces) - ] | str collect) + ] | str join) $time_segment } diff --git a/strings/remove-diacritics.nu b/strings/remove-diacritics.nu index 2f4090d5..926e9c4b 100644 --- a/strings/remove-diacritics.nu +++ b/strings/remove-diacritics.nu @@ -41,5 +41,5 @@ def remove-diacritics [ |get -i -s $char |default $char } - |str collect '' + |str join '' } diff --git a/virtual_environments/auto-venv/venvs/python-venv.nu b/virtual_environments/auto-venv/venvs/python-venv.nu index c7efe6b3..7ee970d0 100644 --- a/virtual_environments/auto-venv/venvs/python-venv.nu +++ b/virtual_environments/auto-venv/venvs/python-venv.nu @@ -57,7 +57,7 @@ export def-env auto-venv-on-enter [ ) let venv_path = ([$virtual_env $bin] | path join) - let new_path = ($old_path | prepend $venv_path | str collect $path_sep) + let new_path = ($old_path | prepend $venv_path | str join $path_sep) # Creating the new prompt for the session let virtual_prompt = if ($virtual_prompt == '') {