From 27b7cdbf124bc2c6538ed62deb8aa32ccf0aea1d Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Thu, 29 Apr 2021 09:16:22 -0700 Subject: [PATCH] bug fix: doesn't ask overwrite text Fixes #384 --- src/croc/croc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/croc/croc.go b/src/croc/croc.go index 10ea2b8..8d70aea 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -1267,7 +1267,7 @@ func (c *Client) updateIfRecipientHasFileInfo() (err error) { if !bytes.Equal(fileHash, fileInfo.Hash) { log.Debugf("hashed %s to %x using %s", fileInfo.Name, fileHash, c.Options.HashAlgorithm) log.Debugf("hashes are not equal %x != %x", fileHash, fileInfo.Hash) - if errHash == nil && !c.Options.Overwrite && errRecipientFile == nil { + if errHash == nil && !c.Options.Overwrite && errRecipientFile == nil && !strings.HasPrefix(fileInfo.Name, "croc-stdin-") { log.Debug("asking to overwrite") ans := utils.GetInput(fmt.Sprintf("\nOverwrite '%s'? (y/n) ", path.Join(fileInfo.FolderRemote, fileInfo.Name))) if strings.TrimSpace(strings.ToLower(ans)) != "y" {