Skip to content

Commit

Permalink
fix(v1.0): fix replace
Browse files Browse the repository at this point in the history
  • Loading branch information
cuisongliu committed Mar 24, 2020
1 parent 6eac7d9 commit 4d443aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/sshutil/scp.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func (ss *SSH) CopyForMD5(host, localFilePath, remoteFilePath, md5 string) bool
}
func (ss *SSH) Md5Sum(host, remoteFilePath string) string {
cmd := fmt.Sprintf("md5sum %s | cut -d\" \" -f1", remoteFilePath)
remoteMD5 := ss.CmdToString(host, cmd)
remoteMD5 := ss.CmdToString(host, cmd, "")
return remoteMD5
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/sshutil/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (ss *SSH) LoggerFileSize(host, filename string, size int) {
for {
select {
case <-t.C:
length := ss.CmdToString(host, "ls -l "+filename+" | awk '{print $5}'")
length := ss.CmdToString(host, "ls -l "+filename+" | awk '{print $5}'", "")
length = strings.Replace(length, "\n", "", -1)
length = strings.Replace(length, "\r", "", -1)
lengthByte, _ := strconv.Atoi(length)
Expand Down

0 comments on commit 4d443aa

Please sign in to comment.