From d6ee612c68defbfca238d97f3324cc2ccbf32da7 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Tue, 4 Jun 2024 15:38:46 -0400 Subject: [PATCH] Server stdin migration: fetch --- libmuttonserver.go | 2 +- src/sync/client.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libmuttonserver.go b/libmuttonserver.go index dbb0161..2959ae8 100644 --- a/libmuttonserver.go +++ b/libmuttonserver.go @@ -41,7 +41,7 @@ func main() { switch args[1] { case "fetch": // print all information needed for syncing to stdout for interpretation by the client - sync.GetRemoteDataFromServer(args[2]) + sync.GetRemoteDataFromServer(stdin[0]) case "shear": // shear an entry from the server and add it to the deletions directory deviceIDTargetLocation := strings.Split(args[2], "\x1d") diff --git a/src/sync/client.go b/src/sync/client.go index 5ab52b9..8f91bcc 100644 --- a/src/sync/client.go +++ b/src/sync/client.go @@ -141,7 +141,7 @@ func getRemoteDataFromClient(manualSync bool) (map[string]int64, []string, []str os.Exit(0) // exit silently if the sync job was called automatically, as the user may just be in offline mode } } - output := GetSSHOutput("libmuttonserver fetch "+clientDeviceID[0].Name(), "", manualSync) + output := GetSSHOutput("libmuttonserver fetch", clientDeviceID[0].Name(), manualSync) // split output into slice based on occurrences of "\x1d" outputSlice := strings.Split(output, "\x1d")