From da5a435ed6876c3b83c925d62b06beb6530683b3 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Tue, 4 Jun 2024 15:33:50 -0400 Subject: [PATCH] Server stdin migration: addfolder --- src/sync/client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sync/client.go b/src/sync/client.go index 051cbc7..5ab52b9 100644 --- a/src/sync/client.go +++ b/src/sync/client.go @@ -377,7 +377,7 @@ func ShearRemoteFromClient(targetLocationIncomplete string) { // call the server to remotely shear the target and add it to the deletions list // deviceID and targetLocationIncomplete are separated by \x1d, path separators are replaced with \x1e, and spaces are replaced with \x1f TODO is there a need to combine deviceID and targetLocationIncomplete into one argument? - GetSSHOutput("libmuttonserver shear "+deviceID+"\x1d"+strings.ReplaceAll(strings.ReplaceAll(targetLocationIncomplete, backend.PathSeparator, "\x1e"), " ", "\x1f"), "", false) // TODO seems to already have Windows server support, perhaps copy this approach to AddFolderRemoteFromClient + GetSSHOutput("libmuttonserver shear "+deviceID+"\x1d"+strings.ReplaceAll(strings.ReplaceAll(targetLocationIncomplete, backend.PathSeparator, "\x1e"), " ", "\x1f"), "", false) os.Exit(0) // sync is not required after shearing since the target has already been removed from the local system } @@ -398,8 +398,8 @@ func deletionSync(deletions []string) { // AddFolderRemoteFromClient creates a new entry-containing directory on the local system and calls the server to create the folder remotely func AddFolderRemoteFromClient(targetLocationIncomplete string) { - AddFolderLocal(targetLocationIncomplete) // add the folder on the local system - GetSSHOutput("libmuttonserver addfolder "+strings.ReplaceAll(targetLocationIncomplete, " ", "\x1f"), "", false) // call the server to create the folder remotely TODO Windows server support + AddFolderLocal(targetLocationIncomplete) // add the folder on the local system + GetSSHOutput("libmuttonserver addfolder", strings.ReplaceAll(targetLocationIncomplete, backend.PathSeparator, "\x1d"), false) // call the server to create the folder remotely os.Exit(0) }