mirror of
https://github.com/kemko/xc.git
synced 2026-01-01 15:55:43 +03:00
force scp distribute type for runscript
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user