mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-09-01 22:57:21 -04:00
Fail early if adding an entry to a directory that does not exist (or if the directory is a file)
This commit is contained in:
@@ -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 bool) {
|
||||
func writeEntryCLI(targetLocation string, unencryptedEntry []string, hideSecrets, verifyEntryDoesNotExist bool) {
|
||||
if backend.EntryIsNotEmpty(unencryptedEntry) {
|
||||
// write the entry to the target location
|
||||
backend.WriteEntry(targetLocation, unencryptedEntry)
|
||||
backend.WriteEntry(targetLocation, unencryptedEntry, verifyEntryDoesNotExist)
|
||||
// preview the entry
|
||||
fmt.Println(AnsiBold + "\nEntry Preview:" + backend.AnsiReset)
|
||||
EntryReader(unencryptedEntry, hideSecrets, true)
|
||||
|
||||
Reference in New Issue
Block a user