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 = 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()