Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCommand ¶
NewCommand creates an executor that will run the provided step. It returns an executor configured from the step, or an error if creating the command configuration fails. If the step has multiple commands, it returns a multiCommandExecutor that runs them sequentially.
func NewCommandConfig ¶
NewCommandConfig creates a commandConfig populated from the given context and step. The returned config uses the environment from runtime.GetEnv(ctx) for Dir and Shell, extracts Command/Args from the first command entry, and sets UserSpecifiedShell to true when the step explicitly provided a Shell. It returns the constructed *commandConfig and a nil error.
Types ¶
type Shell ¶ added in v1.25.0
type Shell interface {
// Match returns true if this shell handles the given executable name.
// The name is lowercase and without path (e.g., "bash", "powershell.exe").
Match(name string) bool
// Build constructs an exec.Cmd for executing the command in this shell.
Build(ctx context.Context, b *shellCommandBuilder) (*exec.Cmd, error)
}
Shell defines the interface for shell-specific command building. Each shell type (bash, PowerShell, cmd, nix-shell) implements this interface to handle its unique argument syntax and behaviors.