From 854bd906f096de41797bb6451c1135b620e87e87 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Thu, 16 May 2024 21:15:16 -0400 Subject: [PATCH] When a folder is created on the client, also create it on the server --- libmuttonserver.go | 3 +++ mutn.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libmuttonserver.go b/libmuttonserver.go index 11c94aa..16c62b7 100644 --- a/libmuttonserver.go +++ b/libmuttonserver.go @@ -24,6 +24,9 @@ func main() { deviceIDTargetLocation := strings.Split(args[2], "\x1d") targetLocationIncomplete := strings.ReplaceAll(strings.ReplaceAll(deviceIDTargetLocation[1], "\x1f", " "), "\x1e", backend.PathSeparator) sync.Shear(targetLocationIncomplete, deviceIDTargetLocation[0]) + case "addfolder": + // add a new folder to the server + sync.AddFolder(strings.ReplaceAll(args[2], "\x1f", " "), true) case "register": // register a new device ID os.Create(backend.ConfigDir + backend.PathSeparator + "devices" + backend.PathSeparator + args[2]) diff --git a/mutn.go b/mutn.go index 3ded61e..43d9213 100644 --- a/mutn.go +++ b/mutn.go @@ -142,7 +142,7 @@ func main() { case "note", "-n": cli.AddEntry(targetLocation, true, 2) case "folder", "-f": - backend.AddFolder(targetLocation) + sync.AddFolder(args[1], false) default: cli.HelpAdd() }