wisski-cloud-distillery/internal/wisski/ingredient/barrel/shell.go
Tom Wiesing 3455f491ca
Add context
This commit adds and passes context around to (almost) every function.
This allows cancelling (almost) every function call globally.
2022-11-29 15:32:31 +01:00

12 lines
342 B
Go

package barrel
import (
"context"
"github.com/tkw1536/goprogram/stream"
)
// Shell executes a shell command inside the instance.
func (barrel *Barrel) Shell(ctx context.Context, io stream.IOStream, argv ...string) (int, error) {
return barrel.Stack().Exec(ctx, io, "barrel", "/bin/sh", append([]string{"/user_shell.sh"}, argv...)...)
}