1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 22:57:46 +00:00

upgrade to 0.91 (#776)

update argx.nu, docker.nu, git-v2.nu, kubernetes.nu, ssh.nu, and nvim.nu
to support 0.91 syntax.

---------

Co-authored-by: nash <nash@iffy.me>
This commit is contained in:
fj0r 2024-03-06 20:08:26 +08:00 committed by GitHub
parent 351691f118
commit 0fd766871f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 39 additions and 27 deletions

View file

@ -77,12 +77,24 @@ export def gb [
] {
let bs = git branch | lines | each {|x| $x | str substring 2..}
if ($branch | is-empty) {
let d = {
local: (git branch | lines)
remote: (git branch --remote | lines)
no-merged: (git branch --no-merged | lines)
let no_merged = git branch --no-merged | lines | str trim
{
local: (git branch)
remote: (git branch --remote)
}
print ($d | table -i 1 -e)
| transpose k v
| each {|x|
$x.v | lines
| each {|n|
let n = $n | parse -r '\s*(?P<c>\*)?\s*(?P<b>[^\s]+)( -> )?(?P<r>[^\s]+)?' | get 0
let c = if ($n.c | is-empty) { null } else { true }
let r = if ($n.r | is-empty) { null } else { $n.r }
let nm = if $n.b in $no_merged { true } else { null }
let rm = if $x.k == 'remote' { true } else { null }
{ current: $c, remote: $rm, branch: $n.b, ref: $r, no-merged: $nm }
}
}
| flatten
} else if $delete {
if $branch in $bs and (agree 'branch will be delete!') {
git branch -D $branch
@ -318,7 +330,7 @@ export def gr [
git rebase --skip
} else if $quit {
git rebase --quit
} else if not ($onto | is-empty) {
} else if ($onto | is-not-empty) {
git rebase --onto $branch
} else {
let i = if $interactive {[--interactive]} else {[]}