Sync with latest libmutton development version; draft documentation for release v0.4.0

This commit is contained in:
2026-01-08 21:23:36 -05:00
parent 9af456590c
commit 32364717dc
8 changed files with 39 additions and 40 deletions
+2 -4
View File
@@ -102,8 +102,7 @@ func CopyMenu(vanityPath string, decSlice []string, oldPassword string) {
}
selectedField = fieldOptions[choice-1]
if selectedField == "Old Password" {
err = clip.CopyString(false, oldPassword)
if err != nil {
if err = clip.CopyString(false, oldPassword); err != nil {
other.PrintError("Failed to copy old password to clipboard: "+err.Error(), global.ErrorClipboard)
}
continue
@@ -115,8 +114,7 @@ func CopyMenu(vanityPath string, decSlice []string, oldPassword string) {
done := make(chan bool)
go clip.TOTPCopier(decSlice[2], errorChan, done)
// block until first successful copy
err = <-errorChan
if err != nil {
if err = <-errorChan; err != nil {
other.PrintError("Failed to copy TOTP token: "+err.Error(), global.ErrorClipboard)
}
fmt.Println(back.AnsiGreen + "[Started]" + back.AnsiReset + " TOTP clipboard refresher")
+2 -4
View File
@@ -18,8 +18,7 @@ import (
func RenameCli(oldVanityPath string) {
// prompt user for new location and rename
newVanityPath := front.Input("New location:")
err := syncclient.RenameRemote(oldVanityPath, newVanityPath)
if err != nil {
if err := syncclient.RenameRemote(oldVanityPath, newVanityPath); err != nil {
other.PrintError("Failed to rename entry: "+err.Error(), back.ErrorWrite)
}
@@ -131,8 +130,7 @@ func editNote(baseNote []string) ([]string, bool) {
cmd.Stdout = os.Stdout
cmd.Stdin = os.Stdin
cmd.Stderr = os.Stderr
err = cmd.Run()
if err != nil {
if err = cmd.Run(); err != nil {
panic(back.AnsiError + "Failed to write note with " + editor + back.AnsiReset) // panic is used to ensure the tempFile is removed, as per the defer statement
}
+1 -2
View File
@@ -30,8 +30,7 @@ func inputPasswordGen() string {
// writeEntryCLI writes an entry to realPath and previews it (errors if no data is supplied).
func writeEntryCLI(realPath string, decSlice []string, passwordIsNew bool, oldPassword string) {
if core.EntryIsNotEmpty(decSlice) {
err := core.WriteEntry(realPath, decSlice, passwordIsNew)
if err != nil {
if err := core.WriteEntry(realPath, decSlice, passwordIsNew); err != nil {
other.PrintError("Failed to write entry: "+err.Error(), back.ErrorWrite)
}
// preview the entry