From b09a1c8132adc30eaf5cb6f17ebebd934333d0b3 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Sun, 3 Mar 2024 23:26:39 -0500 Subject: [PATCH] Greatly reduce code duplication in clipboard implementations --- src/cli/entryReader.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/cli/entryReader.go b/src/cli/entryReader.go index 9d993b0..0fd3d0c 100644 --- a/src/cli/entryReader.go +++ b/src/cli/entryReader.go @@ -65,9 +65,7 @@ func EntryReader(decryptedEntry []string, hidePassword bool) { } func EntryReaderShortcut(targetLocation string, hidePassword bool) { - if isFile, _ := offline.TargetIsFile(targetLocation, true); isFile { + if isFile, _ := offline.TargetIsFile(targetLocation, true, 2); isFile { EntryReader(offline.DecryptGPG(targetLocation), hidePassword) - } else { - fmt.Println(offline.AnsiError + "Failed to read \"" + targetLocation + "\" - it is a directory" + offline.AnsiReset) } }