Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Joakim Bygdell <[email protected]>
  • Loading branch information
pahatz and jbygdell authored Oct 22, 2024
1 parent 3061102 commit e00c555
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions decrypt/decrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)
Expand Down

0 comments on commit e00c555

Please sign in to comment.