// "sync" sub-command: sync files
-// Copyright (C) 2021 Simon Ruderich
+// Copyright (C) 2021-2022 Simon Ruderich
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
"ruderich.org/simon/safcm"
"ruderich.org/simon/safcm/cmd/safcm/config"
+ "ruderich.org/simon/safcm/frontend"
"ruderich.org/simon/safcm/rpc"
)
if err != nil {
return err
}
- x, err := s.sendRecv(conn, req)
+ resp, err := s.loop.HostSyncMsg(s, conn, req)
if err != nil {
return err
}
- resp, ok := x.(safcm.MsgSyncResp)
- if !ok {
- return fmt.Errorf("unexpected response %v", x)
- }
// Display changes
- changes := s.formatChanges(resp)
+ c := frontend.Changes{
+ DryRun: s.config.DryRun,
+ Quiet: s.config.Quiet,
+ IsTTY: s.isTTY,
+ }
+ changes := c.FormatChanges(resp)
if changes != "" {
s.log(safcm.LogInfo, true, changes)
}