From 8c138abe1ae76aa30477f7198a5bcf4f0f1a66f8 Mon Sep 17 00:00:00 2001 From: Benjamin VAUDOUR Date: Sun, 26 Dec 2021 10:36:12 +0000 Subject: [PATCH] =?UTF-8?q?Correction=20build=20carapace=20+=20correction?= =?UTF-8?q?=20autocompl=C3=A9tion=20des=20chemins=20distants=20pour=20scp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aliases/carapace.elv | 2 +- lib/moi/completion/ssh.elv | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/aliases/carapace.elv b/aliases/carapace.elv index f31bbae..4ccc987 100644 --- a/aliases/carapace.elv +++ b/aliases/carapace.elv @@ -6,7 +6,7 @@ edit:add-var updatecarapace~ {|| git pull cd cmd/carapace go generate ./... - go build -ldflags="-s -w" + go build -ldflags="-s -w" -tags release if (bool ?(test -f carapace)) { mv -f carapace $bd } diff --git a/lib/moi/completion/ssh.elv b/lib/moi/completion/ssh.elv index 3d8619c..2d282b9 100644 --- a/lib/moi/completion/ssh.elv +++ b/lib/moi/completion/ssh.elv @@ -44,9 +44,12 @@ fn -complete-domains {|name hosts| } 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 { - ssh -p $port $address 'ls '$dir | each {|f| - put $address':'$dir$f + ssh -p $port $address $cmd | each {|f| + put $address':'$f } } except e { } @@ -71,13 +74,6 @@ fn -complete-args {|hosts cmd @argv| set h = $h[..$i] if (list:includes $h $hosts) { 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 } return