From 4177ed91a19aaeaca17a80ae8656021b36235dae Mon Sep 17 00:00:00 2001 From: Pavel Vorobyov Date: Mon, 11 Nov 2019 12:47:55 +0300 Subject: [PATCH] force scp distribute type for runscript --- cli/cli.go | 8 +++++++- cli/help.go | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cli/cli.go b/cli/cli.go index 8f4e998..ed2b27c 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -416,6 +416,12 @@ func (c *Cli) dorunscript(mode execMode, argsLine string) { remoteFilename = fmt.Sprintf("tmp.xc.%s_%s", now, filepath.Base(localFilename)) remoteFilename = filepath.Join(c.remoteTmpDir, remoteFilename) + if c.distributeType != remote.CTScp { + currentDistributeType := c.distributeType + remote.SetDistributeType(remote.CTScp) + defer remote.SetDistributeType(currentDistributeType) + } + dr := remote.Distribute(hosts, localFilename, remoteFilename, false) copyError := dr.ErrorHosts hosts = dr.SuccessHosts @@ -500,7 +506,7 @@ func (c *Cli) runRC(rcfile string) { } defer f.Close() - term.Successf("Running rcfile %s...", rcfile) + term.Successf("Running rcfile %s...\n", rcfile) sc := bufio.NewScanner(f) for sc.Scan() { cmd := sc.Text() diff --git a/cli/help.go b/cli/help.go index d1ec3b4..9b21691 100644 --- a/cli/help.go +++ b/cli/help.go @@ -383,7 +383,7 @@ func generalHelp() { List of commands: alias creates a local alias command cd changes current working directory - collapse shortcut for "mode collapse" + collapse shortcut for "mode collapse" debug one shouldn't use this delay sets a delay between hosts in serial mode distribute copies a file to a number of hosts in parallel