Skip to content

Commit

Permalink
fix: move the logging line
Browse files Browse the repository at this point in the history
  • Loading branch information
james03160927 committed Aug 28, 2024
1 parent f9d5fb2 commit e01ef3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/ssh/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ func listFileInRemoteDir(t testing.TestingT, sshSession *SshSession, options Scp

// Added based on code: https://github.com/bramvdbogaerde/go-scp/pull/6/files
func copyFileFromRemote(t testing.TestingT, sshSession *SshSession, file *os.File, remotePath string, useSudo bool) error {
logger.Logf(t, "Running command %s on %s@%s", sshSession.Options.Command, sshSession.Options.Username, sshSession.Options.Address)
if err := setUpSSHClient(sshSession); err != nil {
return err
}
Expand All @@ -455,6 +454,8 @@ func copyFileFromRemote(t testing.TestingT, sshSession *SshSession, file *os.Fil
command = fmt.Sprintf("sudo %s", command)
}

logger.Logf(t, "Running command %s on %s@%s", command, sshSession.Options.Username, sshSession.Options.Address)

r, err := sshSession.Session.Output(command)
if err != nil {
fmt.Printf("error reading from remote stdout: %s", err)
Expand Down

0 comments on commit e01ef3d

Please sign in to comment.