Version: v0.12.0 Latest Latest

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

Go to latest
Published: Dec 27, 2022 License: Apache-2.0 Imports: 11 Imported by: 9




View Source
const (
	DefaultExitCodeOnError = 128

Error code for non exec error


This section is empty.


func DoHeadless

func DoHeadless(command []string, env map[string]string) (int, error)

func Lookup added in v0.3.1

func Lookup(bin string, extraLookupPaths []string) (string, error)

func Prepare

func Prepare(s Spec) (*exec.Cmd, error)

Prepare an unstarted exec.Cmd

func StartNoLookPath added in v0.9.0

func StartNoLookPath(cmd *exec.Cmd) error

StartNoLookPath is an alternative to os/exec.Cmd.Start() it starts cmd without looking up path with extensions on windows


type Cmd added in v0.3.1

type Cmd struct {
	ExecCmd *exec.Cmd

	// stdin/stdout set when created with tty enabled
	TtyInput  io.WriteCloser
	TtyOutput io.ReadCloser
	// contains filtered or unexported fields

func Do

func Do(s Spec) (*Cmd, error)

Do execute command directly in local host

func (*Cmd) Release added in v0.3.1

func (c *Cmd) Release() error

Release process if wait was not called and you want to terminate it

func (*Cmd) Resize added in v0.3.1

func (c *Cmd) Resize(cols, rows uint16) error

Resize tty windows if was created with tty enabled

func (*Cmd) Wait added in v0.3.1

func (c *Cmd) Wait() (int, error)

Wait until command exited

type Spec

type Spec struct {
	Context context.Context

	// set working directory when running the command
	Dir string

	Env         map[string]string
	Command     []string
	SysProcAttr *syscall.SysProcAttr

	ExtraLookupPaths []string

	// stdin/stdout/stderr streams, not used if Tty is set to true
	Stdin          io.Reader
	Stdout, Stderr io.Writer

	Tty bool

Jump to

Keyboard shortcuts

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