git branch cleanup returns errors.
When calling git branch-cleanup, it returns this error:
× Lists are not automatically spread when calling external commands
╭─[C:\Users\Stijn\AppData\Roaming\nushell\scripts\git_branch_cleanup.nu:88:55]
87 │
88 │ run-external --redirect-stdout "git" "symbolic-ref" $args
· ──┬──
· ╰── Spread operator (...) is necessary to spread lists
89 │ | str trim
╰────
help: Either convert the list to a string or use the spread operator, like so: ...$args
I tried adding a spread operator, but that broke the script. Any ideas on how to fix it?
I suspect this is because of 2 reasons
--redirect-stdoutand--redirect-stderrhave been deprecated- all the rest arguments to custom commands need to use the spread operator, not in just one custom command.
I suspect this was fixed in #799 , is that correct @TeaDrinkingProgrammer ?
Some errors have been resolved, but --redirect-stdout is still used, so I get depricated warnings for that and the script also doesn't seem to work anymore:
Error: × Deprecated flag
╭─[C:\Users\Stijn\AppData\Roaming\nushell\scripts\git_branch_cleanup.nu:59:16]
58 │ def current_branch [] {
59 │ run-external --redirect-stdout "git" "branch" "--show-current"
· ────────────────────────┬────────────────────────
· ╰── --redirect-stdout is deprecated
60 │ | into string
╰────
help: run-external will now always redirect stdout if there is a pipe | afterwards
Error: × Deprecated flag
╭─[C:\Users\Stijn\AppData\Roaming\nushell\scripts\git_branch_cleanup.nu:88:16]
87 │
88 │ run-external --redirect-stdout "git" "symbolic-ref" $args
· ──────────────────────┬─────────────────────
· ╰── --redirect-stdout is deprecated
89 │ | str trim
╰────
help: run-external will now always redirect stdout if there is a pipe | afterwards
Error: nu::shell::cannot_pass_list_to_external
× Lists are not automatically spread when calling external commands ╭─[C:\Users\Stijn\AppData\Roaming\nushell\scripts\git_branch_cleanup.nu:88:55] 87 │ 88 │ run-external --redirect-stdout "git" "symbolic-ref" $args · ──┬── · ╰── Spread operator (...) is necessary to spread lists 89 │ | str trim ╰──── help: Either convert the list to a string or use the spread operator, like so: ...$args
The deprecation warning is because the CI is using latest nushell version 0.92, released Apr-02, here is a link to the deprecated commands chapter in the blogpost
It looks like this has been resolved through #799 and #827. Please close as completed.