diff --git a/decrypt/decrypt.go b/decrypt/decrypt.go index a1cae765..fd9f4bd1 100644 --- a/decrypt/decrypt.go +++ b/decrypt/decrypt.go @@ -94,7 +94,8 @@ func Decrypt(args []string) error { err := decryptFile(file.Encrypted, file.Unencrypted, *privateKey) if err != nil { fmt.Fprintf(os.Stderr, "Error decrypting file %s: %v\n", file.Encrypted, err) - decryptedCount-- + + continue } decryptedCount++ case helpers.FileExists(file.Unencrypted): @@ -104,12 +105,13 @@ func Decrypt(args []string) error { err := decryptFile(file.Encrypted, file.Unencrypted, *privateKey) if err != nil { fmt.Fprintf(os.Stderr, "Error decrypting file %s: %v\n", file.Encrypted, err) - decryptedCount-- + + continue } decryptedCount++ } // remove the encrypted file if the clean flag is set - if *clean && helpers.FileIsReadable(file.Encrypted) { + if *clean { err = os.Remove(file.Encrypted) if err != nil { fmt.Fprintf(os.Stderr, "Could not remove encrypted file %s: %s", file.Encrypted, err)