From 1230c8a43766cf0c214f431a5de0284deeef3140 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Fri, 17 May 2024 19:36:23 -0400 Subject: [PATCH] Make server respond to "fetch" with output formatted for the client's OS family --- libmuttonserver.go | 4 +++- src/cli/entryReader.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libmuttonserver.go b/libmuttonserver.go index 18e717e..f179c94 100644 --- a/libmuttonserver.go +++ b/libmuttonserver.go @@ -6,6 +6,7 @@ import ( "github.com/rwinkhart/MUTN/src/cli" "github.com/rwinkhart/MUTN/src/sync" "os" + "strconv" "strings" ) @@ -18,7 +19,8 @@ func main() { switch args[1] { case "fetch": // print all information needed for syncing to stdout for interpretation by the client - sync.GetRemoteDataFromServer(args[2]) + clientIsWindows, _ := strconv.ParseBool(args[3]) + sync.GetRemoteDataFromServer(args[2], clientIsWindows) 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/cli/entryReader.go b/src/cli/entryReader.go index 755d21b..3bbbb52 100644 --- a/src/cli/entryReader.go +++ b/src/cli/entryReader.go @@ -57,7 +57,7 @@ func EntryReader(decryptedEntry []string, hidePassword bool, sync bool) { } } - if sync && !backend.Windows { + if sync && !backend.IsWindows { SshypSync() // TODO Remove after native sync is implemented }