exec

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package exec provides helper functions and Actions for executing shell commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandWithOpts

func CommandWithOpts(ctx context.Context, opts RunOpts) *exec.Cmd

CommandWithOpts returns the equivalent *exec.Cmd that matches the RunOpts provided (opts).

func Run

func Run(ctx context.Context, opts pipeline.ActionOpts, name string, args ...string) error

func RunAction

func RunAction(name string, arg ...string) pipeline.Action

RunAction returns an action that runs a given command and set of arguments. The command's stdout and stderr are assigned the systems' stdout/stderr streams.

func RunAt

func RunAt(path string, name string, arg ...string) pipeline.Action

Run returns an action that runs a given command and set of arguments. The command's stdout and stderr are assigned the systems' stdout/stderr streams.

func RunCommand

func RunCommand(ctx context.Context, stdout, stderr io.Writer, name string, arg ...string) error

RunCommand runs a given command and set of arguments. The command's stdout and stderr are assigned the systems' stdout/stderr streams.

func RunCommandAt

func RunCommandAt(ctx context.Context, stdout, stderr io.Writer, path string, name string, arg ...string) error

RunCommandAt runs a given command and set of arguments at the given location The command's stdout and stderr are assigned the systems' stdout/stderr streams.

func RunCommandWithOpts

func RunCommandWithOpts(ctx context.Context, opts RunOpts) error

RunCommandWithOpts runs the command defined by the RunOpts provided (opts). Be warned that the stdout and stderr are not captured by this function and are instead written to opts.Stdout/opts.Stderr.

Types

type RunOpts

type RunOpts struct {
	Path   string
	Stdout io.Writer
	Stderr io.Writer
	Name   string
	Args   []string
	Env    []string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL