environment/exec: Seperate Exec and Wait

This commit is contained in:
Tom Wiesing 2022-12-14 08:53:45 +01:00
parent 2a308ee03c
commit a590d93e76
No known key found for this signature in database
14 changed files with 90 additions and 117 deletions

View file

@ -32,10 +32,7 @@ func (mysql) Description() wisski_distillery.Description {
}
func (ms mysql) Run(context wisski_distillery.Context) error {
code, err := context.Environment.SQL().Shell(context.Context, context.IOStream, ms.Positionals.Args...)
if err != nil {
return err
}
code := context.Environment.SQL().Shell(context.Context, context.IOStream, ms.Positionals.Args...)
if code != 0 {
return exit.Error{
ExitCode: exit.ExitCode(uint8(code)),

View file

@ -43,10 +43,7 @@ func (sh shell) Run(context wisski_distillery.Context) error {
return err
}
code, err := instance.Barrel().Shell(context.Context, context.IOStream, sh.Positionals.Args...)
if err != nil {
return errShell.WithMessageF(err)
}
code := instance.Barrel().Shell(context.Context, context.IOStream, sh.Positionals.Args...)()
if code != 0 {
return exit.Error{
ExitCode: exit.ExitCode(uint8(code)),

View file

@ -194,7 +194,7 @@ func (si systemupdate) mustExec(context wisski_distillery.Context, workdir strin
if workdir == "" {
workdir = dis.Config.DeployRoot
}
code := dis.Still.Environment.Exec(context.Context, context.IOStream, workdir, exe, argv...)
code := dis.Still.Environment.Exec(context.Context, context.IOStream, workdir, exe, argv...)()
if code != 0 {
err := errMustExecFailed.WithMessageF(code)
err.ExitCode = exit.ExitCode(code)