Correction build carapace + correction autocomplétion des chemins distants pour scp
This commit is contained in:
parent
2a84b5804f
commit
8c138abe1a
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue