aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-09-04 23:20:29 +0700
committerShulhan <ms@kilabit.info>2023-09-04 23:20:29 +0700
commit83d746e4f95d661fc0ab21238b34eeecd2288412 (patch)
treef3a8671fcc715803109e120a6380579ec48722f7
parente7dc577ba54ec9b9f29c1b6845765f637e1b6408 (diff)
downloadawwan-83d746e4f95d661fc0ab21238b34eeecd2288412.tar.xz
go.mod: update share module
The latest update on share module contains refactoring on lib/ssh.
-rw-r--r--go.mod10
-rw-r--r--go.sum20
-rw-r--r--session.go15
3 files changed, 22 insertions, 23 deletions
diff --git a/go.mod b/go.mod
index 4b95519..b309025 100644
--- a/go.mod
+++ b/go.mod
@@ -8,17 +8,17 @@ go 1.19
require (
git.sr.ht/~shulhan/ciigo v0.10.0
github.com/evanw/esbuild v0.17.10
- github.com/shuLhan/share v0.46.0
+ github.com/shuLhan/share v0.49.1
)
require (
git.sr.ht/~shulhan/asciidoctor-go v0.4.1 // indirect
github.com/yuin/goldmark v1.5.4 // indirect
github.com/yuin/goldmark-meta v1.1.0 // indirect
- golang.org/x/crypto v0.6.0 // indirect
- golang.org/x/net v0.7.0 // indirect
- golang.org/x/sys v0.5.0 // indirect
- golang.org/x/term v0.5.0 // indirect
+ golang.org/x/crypto v0.12.0 // indirect
+ golang.org/x/net v0.12.0 // indirect
+ golang.org/x/sys v0.11.0 // indirect
+ golang.org/x/term v0.11.0 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
)
diff --git a/go.sum b/go.sum
index ba42309..4e47949 100644
--- a/go.sum
+++ b/go.sum
@@ -4,21 +4,21 @@ git.sr.ht/~shulhan/ciigo v0.10.0 h1:s1SJ3/NzBcbOLmEZ4z1Cx9Vf7ZdDIvm45b7KMCZKzEY=
git.sr.ht/~shulhan/ciigo v0.10.0/go.mod h1:cG6av+ywJZZp96F43kmLB2QWjm2hYiahbsbeTX/vlgk=
github.com/evanw/esbuild v0.17.10 h1:RMwM8ehohA6RSgWVirjnsZ+u9ttNt0gWfRLYCxUbAoc=
github.com/evanw/esbuild v0.17.10/go.mod h1:iINY06rn799hi48UqEnaQvVfZWe6W9bET78LbvN8VWk=
-github.com/shuLhan/share v0.46.0 h1:cF0Ngj7wVA6TIcdSmfrqxOwMB3hZ+4df5cJf4GGCun4=
-github.com/shuLhan/share v0.46.0/go.mod h1:BhnIWJxq84BTOs3Z2gLFAN8ih9mBfhZbRIjqGupGJag=
+github.com/shuLhan/share v0.49.1 h1:Y4LSCewjYKDxRYfyYZ2WRGs/aJ8JI5JRPw8vsS3TGWc=
+github.com/shuLhan/share v0.49.1/go.mod h1:cuTw2WIcltSOPfUasvDpxHUNpBErzCBjk+YnKQHCLm8=
github.com/yuin/goldmark v1.5.4 h1:2uY/xC0roWy8IBEGLgB1ywIoEJFGmRrX21YQcvGZzjU=
github.com/yuin/goldmark v1.5.4/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc=
github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0=
-golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc=
-golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
-golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
-golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
+golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
+golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
+golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50=
+golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
-golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY=
-golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
+golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
+golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0=
+golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
diff --git a/session.go b/session.go
index 6d5cd02..19a6a1d 100644
--- a/session.go
+++ b/session.go
@@ -397,7 +397,7 @@ func (ses *Session) executeScriptOnLocal(req *Request, pos linePosition) {
continue
}
- fmt.Fprintf(req.stdout, "\n>>> local: %3d: %s %s\n", x, stmt.cmd, stmt.args)
+ fmt.Fprintf(req.stdout, "\n>>> local: %3d: %s\n", x, stmt.raw)
var err error
switch stmt.kind {
@@ -507,11 +507,10 @@ func (ses *Session) initSSHClient(req *Request, sshSection *config.Section) (err
lastIdentFile = sshSection.IdentityFile[len(sshSection.IdentityFile)-1]
}
- fmt.Fprintf(req.stdout, "--- SSH connection: %s@%s:%s\n",
- sshSection.User, sshSection.Hostname, sshSection.Port)
- fmt.Fprintf(req.stdout, "--- SSH identity file: %s\n", lastIdentFile)
+ fmt.Fprintf(req.stdout, "--- SSH connection: %s@%s:%s\n", sshSection.User(), sshSection.Hostname(), sshSection.Port())
+ fmt.Fprintf(req.stdout, "--- SSH identity file: %v\n", sshSection.IdentityFile)
- ses.sshClient, err = ssh.NewClientFromConfig(sshSection)
+ ses.sshClient, err = ssh.NewClientInteractive(sshSection)
if err != nil {
return fmt.Errorf("%s: %w", logp, err)
}
@@ -525,9 +524,9 @@ func (ses *Session) initSSHClient(req *Request, sshSection *config.Section) (err
ses.sshClient.SetSessionOutputError(req.stdout, req.stderr)
ses.SSHKey = lastIdentFile
- ses.SSHUser = sshSection.User
- ses.SSHHost = sshSection.Hostname
- ses.SSHPort = sshSection.Port
+ ses.SSHUser = sshSection.User()
+ ses.SSHHost = sshSection.Hostname()
+ ses.SSHPort = sshSection.Port()
return nil
}