From 7d0cb0e25acf136de733dc1fe08048e3449ea826 Mon Sep 17 00:00:00 2001 From: Gareth Kirwan Date: Mon, 20 Jan 2025 10:51:14 +0700 Subject: [PATCH] fixup! Config: Fix config version downgrade --- cmd/config/config.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/config/config.go b/cmd/config/config.go index 194d5ed4f4e..60690e15390 100644 --- a/cmd/config/config.go +++ b/cmd/config/config.go @@ -57,6 +57,9 @@ func main() { if cmd == "encrypt" && isEncrypted { fatal("Error: File is already encrypted") } + if cmd == "decrypt" && !isEncrypted { + fatal("Error: File is already decrypted") + } if len(key) == 0 && (isEncrypted || cmd == "encrypt") { if key, err = config.PromptForConfigKey(cmd == "encrypt"); err != nil {