Bump version to 1.0.19
This commit is contained in:
@@ -157,29 +157,6 @@ func (r *RsyncRunner) buildArgs(pair *SyncPairConfig) []string {
|
||||
return args
|
||||
}
|
||||
|
||||
func (r *RsyncRunner) buildRemoteArgs(pair *SyncPairConfig) []string {
|
||||
var args []string
|
||||
|
||||
flags := strings.Fields(pair.RsyncFlags)
|
||||
args = append(args, flags...)
|
||||
|
||||
for _, pattern := range pair.ExcludePatterns {
|
||||
args = append(args, "--exclude="+pattern)
|
||||
}
|
||||
|
||||
if pair.Direction == "mirror" {
|
||||
args = append(args, "--delete")
|
||||
}
|
||||
|
||||
if pair.Direction == "pull" {
|
||||
args = append(args, pair.Dest, pair.Source)
|
||||
} else {
|
||||
args = append(args, pair.Source, pair.Dest)
|
||||
}
|
||||
|
||||
return args
|
||||
}
|
||||
|
||||
type RemoteMachine struct {
|
||||
Host string
|
||||
Port int
|
||||
@@ -205,19 +182,13 @@ func (r *RsyncRunner) RunRemote(ctx context.Context, pair *SyncPairConfig, remot
|
||||
}
|
||||
|
||||
sshArgs := []string{
|
||||
"ssh",
|
||||
"-i", remote.PrivKey,
|
||||
"-o", "StrictHostKeyChecking=accept-new",
|
||||
"-o", "UserKnownHostsFile=" + strings.TrimRight(r.sshDir, "/") + "/known_hosts",
|
||||
"-p", fmt.Sprintf("%d", remote.Port),
|
||||
fmt.Sprintf("%s@%s", remote.SSHUser, remote.Host),
|
||||
}
|
||||
if remote.DestPrivKey != "" {
|
||||
sshArgs = append(sshArgs, "bash", "-c", remoteCmd)
|
||||
} else {
|
||||
sshArgs = append(sshArgs, "rsync")
|
||||
sshArgs = append(sshArgs, args...)
|
||||
}
|
||||
sshArgs = append(sshArgs, remoteCmd)
|
||||
|
||||
cmd := exec.CommandContext(ctx, "ssh", sshArgs...)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user