mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-09-01 14:47:21 -04:00
Do not check if an entry already exists when writing (add); an earlier check is already performed
This commit is contained in:
+1
-1
@@ -48,5 +48,5 @@ func AddEntry(targetLocation string, hideSecrets bool, entryType uint8) {
|
||||
}
|
||||
|
||||
// write and preview the new entry
|
||||
writeEntryCLI(targetLocation, unencryptedEntry, hideSecrets, false)
|
||||
writeEntryCLI(targetLocation, unencryptedEntry, hideSecrets)
|
||||
}
|
||||
|
||||
+2
-2
@@ -51,7 +51,7 @@ func EditEntryField(targetLocation string, hideSecrets bool, field int) {
|
||||
}
|
||||
|
||||
// write and preview the modified entry
|
||||
writeEntryCLI(targetLocation, unencryptedEntry, hideSecrets, false)
|
||||
writeEntryCLI(targetLocation, unencryptedEntry, hideSecrets)
|
||||
}
|
||||
|
||||
// GenUpdate generates a new password for an entry at targetLocation (user input).
|
||||
@@ -63,7 +63,7 @@ func GenUpdate(targetLocation string, hideSecrets bool) {
|
||||
unencryptedEntry[0] = core.StringGen(inputInt("Password length:", -1), inputBinary("Generate a complex (special characters) password?"), 0.2, false)
|
||||
|
||||
// write and preview the modified entry
|
||||
writeEntryCLI(targetLocation, unencryptedEntry, hideSecrets, false)
|
||||
writeEntryCLI(targetLocation, unencryptedEntry, hideSecrets)
|
||||
}
|
||||
|
||||
// editNote uses the user-specified text editor to edit an existing note (or create a new one if baseNote is empty).
|
||||
|
||||
@@ -65,10 +65,10 @@ func inputMenuGen(prompt string, options []string) int {
|
||||
}
|
||||
|
||||
// writeEntryCLI writes an entry to targetLocation and previews it (errors if no data is supplied).
|
||||
func writeEntryCLI(targetLocation string, unencryptedEntry []string, hideSecrets, verifyEntryDoesNotExist bool) {
|
||||
func writeEntryCLI(targetLocation string, unencryptedEntry []string, hideSecrets bool) {
|
||||
if core.EntryIsNotEmpty(unencryptedEntry) {
|
||||
// write the entry to the target location
|
||||
core.WriteEntry(targetLocation, unencryptedEntry, verifyEntryDoesNotExist)
|
||||
core.WriteEntry(targetLocation, unencryptedEntry)
|
||||
// preview the entry
|
||||
fmt.Println(AnsiBold + "\nEntry Preview:" + core.AnsiReset)
|
||||
EntryReader(unencryptedEntry, hideSecrets, true)
|
||||
|
||||
Reference in New Issue
Block a user