Skip to content

Commit

Permalink
fix: write RemoteCommand to config (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
daca11 committed Feb 17, 2021
1 parent c13753d commit e8f8068
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,7 @@ Host toto7toto
# KnownHostOf: toto[7-9]toto
Host toutou
RemoteCommand date >> /tmp/logs
# Comment: [First line Second line Third line]
# ResolveCommand: dig -t %h
Expand Down
3 changes: 3 additions & 0 deletions pkg/config/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -1301,6 +1301,9 @@ func (h *Host) WriteSSHConfigTo(w io.Writer) error {
if h.LocalCommand != "" {
_, _ = fmt.Fprintf(w, " LocalCommand %s\n", h.LocalCommand)
}
if h.RemoteCommand != "" {
_, _ = fmt.Fprintf(w, " RemoteCommand %s\n", h.RemoteCommand)
}
for _, entry := range h.LocalForward {
_, _ = fmt.Fprintf(w, " LocalForward %s\n", entry)
}
Expand Down

0 comments on commit e8f8068

Please sign in to comment.