Correction build carapace + correction autocomplétion des chemins distants pour scp

This commit is contained in:
Benjamin VAUDOUR 2021-12-26 10:36:12 +00:00
parent 2a84b5804f
commit 8c138abe1a
2 changed files with 6 additions and 10 deletions

View File

@ -6,7 +6,7 @@ edit:add-var updatecarapace~ {||
git pull git pull
cd cmd/carapace cd cmd/carapace
go generate ./... go generate ./...
go build -ldflags="-s -w" go build -ldflags="-s -w" -tags release
if (bool ?(test -f carapace)) { if (bool ?(test -f carapace)) {
mv -f carapace $bd mv -f carapace $bd
} }

View File

@ -44,9 +44,12 @@ fn -complete-domains {|name hosts|
} }
fn -complete-remote-dir {|port address dir| fn -complete-remote-dir {|port address dir|
var cmd = (printf ^
'for f in %s*; do if [[ -d $f ]]; then echo $f/; else echo $f; fi; done' ^
$dir)
try { try {
ssh -p $port $address 'ls '$dir | each {|f| ssh -p $port $address $cmd | each {|f|
put $address':'$dir$f put $address':'$f
} }
} except e { } except e {
} }
@ -71,13 +74,6 @@ fn -complete-args {|hosts cmd @argv|
set h = $h[..$i] set h = $h[..$i]
if (list:includes $h $hosts) { if (list:includes $h $hosts) {
var p = (-port $cmd @argv) var p = (-port $cmd @argv)
var e = [ (str:split / $d) ]
if (not-eq $e[-1] '') {
set d = (str:join / $e[..-1])
if (eq $d '') {
set d = /
}
}
-complete-remote-dir $p $n@$h $d -complete-remote-dir $p $n@$h $d
} }
return return