From 6d557a77c2dee949ccf72dd91278b01bf0c6782b Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Sun, 29 Dec 2024 16:42:34 -0500 Subject: [PATCH] Port to newest libmutton development version --- go.mod | 2 +- go.sum | 4 ++-- mutn.go | 4 ++-- src/cli/edit.go | 5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 99852e9..b76e4c9 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.23.4 require ( github.com/Trojan2021/BEAN v0.0.0-20241210230804-8f294833b514 github.com/charmbracelet/glamour v0.7.0 - github.com/rwinkhart/libmutton v0.2.5-0.20241228200917-a4a39a3a995d + github.com/rwinkhart/libmutton v0.2.5-0.20241229212818-fc2e77d8b80e golang.org/x/term v0.27.0 ) diff --git a/go.sum b/go.sum index a4e943c..a295bb4 100644 --- a/go.sum +++ b/go.sum @@ -58,8 +58,8 @@ github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rwinkhart/convertroman v0.2.0 h1:otUm939eXT77q/Lr31mJtMwVWEw0RjEUB71gO65h9OM= github.com/rwinkhart/convertroman v0.2.0/go.mod h1:Af6HqvX0EIM4Y3HcnNXbbRey1dLasGB7WU0+3Cowgmw= -github.com/rwinkhart/libmutton v0.2.5-0.20241228200917-a4a39a3a995d h1:o9fIg0X3BsGUnVQuQ7SqEDHkCCPFTZIxrrjC2sWmdxc= -github.com/rwinkhart/libmutton v0.2.5-0.20241228200917-a4a39a3a995d/go.mod h1:RLpxGyaNGqMgzRf7Qo4q4sBPnUH6Rjt8B6SE5Rp8gXM= +github.com/rwinkhart/libmutton v0.2.5-0.20241229212818-fc2e77d8b80e h1:SjVRasm0sgUOQYTSwnn9rHQhB1gIxsYDhdGOwAmnlIM= +github.com/rwinkhart/libmutton v0.2.5-0.20241229212818-fc2e77d8b80e/go.mod h1:RLpxGyaNGqMgzRf7Qo4q4sBPnUH6Rjt8B6SE5Rp8gXM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/mutn.go b/mutn.go index 3c116a3..b7b729c 100644 --- a/mutn.go +++ b/mutn.go @@ -46,7 +46,7 @@ func main() { case "add": cli.AddEntry(targetLocation, true, 0) case "shear": - sync.ShearRemoteFromClient(args[1]) // pass the incomplete path as the server and all clients (reading from the deletions directory) will have a different home directory + sync.ShearRemoteFromClient(args[1], false) // pass the incomplete path as the server and all clients (reading from the deletions directory) will have a different home directory default: cli.HelpMain() } @@ -145,7 +145,7 @@ func main() { case "note", "-n": cli.AddEntry(targetLocation, true, 2) case "folder", "-f": - sync.AddFolderRemoteFromClient(args[1]) // pass the incomplete path as the server will have a different home directory + sync.AddFolderRemoteFromClient(args[1], false) // pass the incomplete path as the server will have a different home directory default: cli.HelpAdd() } diff --git a/src/cli/edit.go b/src/cli/edit.go index 932096d..78201cb 100644 --- a/src/cli/edit.go +++ b/src/cli/edit.go @@ -16,7 +16,7 @@ import ( func RenameCli(oldLocationIncomplete string) { // prompt user for new location and rename newLocationIncomplete := input("New location:") - sync.RenameRemoteFromClient(oldLocationIncomplete, newLocationIncomplete) + sync.RenameRemoteFromClient(oldLocationIncomplete, newLocationIncomplete, false) // exit is done from sync.RenameRemoteFromClient } @@ -75,7 +75,8 @@ func editNote(baseNote []string) ([]string, bool) { }(tempFile.Name()) // fetch the user's text editor - editor := core.ParseConfig([][2]string{{"MUTN", "textEditor"}}, "")[0] + editorCfg, _ := core.ParseConfig([][2]string{{"MUTN", "textEditor"}}, "") + editor := editorCfg[0] // write baseNote to tempFile (if it is not empty) if len(baseNote) > 0 {