force scp distribute type for runscript

This commit is contained in:
Pavel Vorobyov
2019-11-11 12:47:55 +03:00
parent 6bf6ffb6d7
commit 4177ed91a1
2 changed files with 8 additions and 2 deletions

View File

@@ -416,6 +416,12 @@ func (c *Cli) dorunscript(mode execMode, argsLine string) {
remoteFilename = fmt.Sprintf("tmp.xc.%s_%s", now, filepath.Base(localFilename)) remoteFilename = fmt.Sprintf("tmp.xc.%s_%s", now, filepath.Base(localFilename))
remoteFilename = filepath.Join(c.remoteTmpDir, remoteFilename) 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) dr := remote.Distribute(hosts, localFilename, remoteFilename, false)
copyError := dr.ErrorHosts copyError := dr.ErrorHosts
hosts = dr.SuccessHosts hosts = dr.SuccessHosts
@@ -500,7 +506,7 @@ func (c *Cli) runRC(rcfile string) {
} }
defer f.Close() defer f.Close()
term.Successf("Running rcfile %s...", rcfile) term.Successf("Running rcfile %s...\n", rcfile)
sc := bufio.NewScanner(f) sc := bufio.NewScanner(f)
for sc.Scan() { for sc.Scan() {
cmd := sc.Text() cmd := sc.Text()

View File

@@ -383,7 +383,7 @@ func generalHelp() {
List of commands: List of commands:
alias creates a local alias command alias creates a local alias command
cd changes current working directory cd changes current working directory
collapse shortcut for "mode collapse" collapse shortcut for "mode collapse"
debug one shouldn't use this debug one shouldn't use this
delay sets a delay between hosts in serial mode delay sets a delay between hosts in serial mode
distribute copies a file to a number of hosts in parallel distribute copies a file to a number of hosts in parallel