feat(cmd): add --tty flag to run commands from a script
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
81b032be85
commit
9ade250f01
|
@ -47,6 +47,7 @@ Example:
|
||||||
internal.DebugFlag,
|
internal.DebugFlag,
|
||||||
internal.LocalCmdFlag,
|
internal.LocalCmdFlag,
|
||||||
internal.RemoteUserFlag,
|
internal.RemoteUserFlag,
|
||||||
|
internal.TtyFlag,
|
||||||
},
|
},
|
||||||
BashComplete: autocomplete.AppNameComplete,
|
BashComplete: autocomplete.AppNameComplete,
|
||||||
Before: internal.SubCommandBefore,
|
Before: internal.SubCommandBefore,
|
||||||
|
@ -236,6 +237,9 @@ func runCmdRemote(cl *dockerClient.Client, app config.App, abraSh, serviceName,
|
||||||
|
|
||||||
execCreateOpts.Cmd = cmd
|
execCreateOpts.Cmd = cmd
|
||||||
execCreateOpts.Tty = true
|
execCreateOpts.Tty = true
|
||||||
|
if internal.Tty {
|
||||||
|
execCreateOpts.Tty = false
|
||||||
|
}
|
||||||
|
|
||||||
if err := container.RunExec(dcli, cl, targetContainer.ID, &execCreateOpts); err != nil {
|
if err := container.RunExec(dcli, cl, targetContainer.ID, &execCreateOpts); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -58,6 +58,16 @@ var ChaosFlag = &cli.BoolFlag{
|
||||||
Destination: &Chaos,
|
Destination: &Chaos,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Disable tty to run commands from script
|
||||||
|
var Tty bool
|
||||||
|
|
||||||
|
// TtyFlag turns on/off tty mode.
|
||||||
|
var TtyFlag = &cli.BoolFlag{
|
||||||
|
Name: "tty, T",
|
||||||
|
Usage: "Disables TTY mode to run this command from a script.",
|
||||||
|
Destination: &Tty,
|
||||||
|
}
|
||||||
|
|
||||||
// DNSProvider specifies a DNS provider.
|
// DNSProvider specifies a DNS provider.
|
||||||
var DNSProvider string
|
var DNSProvider string
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue