Greatly reduce code duplication in clipboard implementations

This commit is contained in:
2024-03-03 23:26:39 -05:00
parent 6fecf5a686
commit 24b899a83a
7 changed files with 112 additions and 140 deletions
+1 -3
View File
@@ -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)
}
}