goexec

package module
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: Apache-2.0 Imports: 6 Imported by: 1

README

goexec

wrap os/exec for human

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exec

type Exec struct {
	Name string   // command name
	Args []string // command args
	// contains filtered or unexported fields
}

func New

func New(args ...string) *Exec

New create new Exec instance

func (*Exec) Dir added in v0.8.0

func (r *Exec) Dir(s string) *Exec

Dir set command run dir

func (*Exec) Env added in v0.8.0

func (r *Exec) Env(k, v string) *Exec

Env set env

func (*Exec) IgnoreEnv

func (r *Exec) IgnoreEnv(envs ...string) *Exec

IgnoreEnv ignore envs

func (*Exec) IgnoreLog added in v0.5.0

func (r *Exec) IgnoreLog() *Exec

IgnoreLog log command

func (*Exec) Run

func (r *Exec) Run() (stdout string, stderr string, err error)

Run run command

func (*Exec) RunInStream

func (r *Exec) RunInStream() error

RunInStream print env to os.stdout and os.stderr

func (*Exec) RunInTee added in v0.4.0

func (r *Exec) RunInTee() (string, string, error)

RunInTee print env to os.stdout and os.stderr

func (*Exec) WithAssert

func (r *Exec) WithAssert() *Exec

WithAssert must run success

Jump to

Keyboard shortcuts

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