Skip to content

Commit e01ef3d

Browse files
committed
fix: move the logging line
1 parent f9d5fb2 commit e01ef3d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/ssh/ssh.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,6 @@ func listFileInRemoteDir(t testing.TestingT, sshSession *SshSession, options Scp
441441

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

457+
logger.Logf(t, "Running command %s on %s@%s", command, sshSession.Options.Username, sshSession.Options.Address)
458+
458459
r, err := sshSession.Session.Output(command)
459460
if err != nil {
460461
fmt.Printf("error reading from remote stdout: %s", err)

0 commit comments

Comments
 (0)