bug fix: doesn't ask overwrite text Fixes #384

This commit is contained in:
Zack Scholl 2021-04-29 09:16:22 -07:00
parent 24fb8746a4
commit 27b7cdbf12
1 changed files with 1 additions and 1 deletions

View File

@ -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" {