aboutsummaryrefslogtreecommitdiff
path: root/session.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-12-14 20:23:19 +0700
committerShulhan <ms@kilabit.info>2023-12-14 20:23:47 +0700
commit7c3b034fc45beac1da465984117d5948110c84e3 (patch)
tree80e1e3b10aeaf919f3713b96047270b04fa09114 /session.go
parent708919bfb67398ca6d0464553faf10aadc28893b (diff)
downloadawwan-7c3b034fc45beac1da465984117d5948110c84e3.tar.xz
all: make the magic line "#local" works on "local" command too
In case we have a script that manage local host and remote server, calling "play" on "#local" lines only always open the connection to remote server. To minimize opening unused connections, let the "#local" command works on both commands. Its up to user which part of lines that they want to execute on remote or local.
Diffstat (limited to 'session.go')
-rw-r--r--session.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/session.go b/session.go
index 52f0388..0510b8d 100644
--- a/session.go
+++ b/session.go
@@ -472,6 +472,8 @@ func (ses *Session) executeScriptOnLocal(req *ExecRequest, pos linePosition) (er
err = ExecLocal(req, stmt)
case statementKindGet:
err = ses.Copy(req, stmt)
+ case statementKindLocal:
+ err = ExecLocal(req, stmt)
case statementKindPut:
err = ses.Copy(req, stmt)
case statementKindSudoGet: