exec

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: MIT Imports: 12 Imported by: 2 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFailedExecuteCommand = errors.New("execute command failed")
)

Functions

func NewUnsupportedIncludePrevArgsError

func NewUnsupportedIncludePrevArgsError(value IncludePrevArgs) error

Types

type CobraOut

type CobraOut interface {
	OutOrStdout() io.Writer
	ErrOrStderr() io.Writer
}

type Executable

type Executable struct {
	// contains filtered or unexported fields
}

func NewExecutable

func NewExecutable(ctx context.Context, cli string, opts ...Option) (*Executable, error)

func (*Executable) Execute

func (ge *Executable) Execute(ctx context.Context, opts ...RestoreOption) error

type IncludePrevArgs

type IncludePrevArgs int
const (
	IncludePrevArgsNo     IncludePrevArgs = iota
	IncludePrevArgsBefore IncludePrevArgs = iota
	IncludePrevArgsAfter  IncludePrevArgs = iota
)

type Option

type Option = itbasisCoreOption.Option[exec.Cmd]

func WithArgs

func WithArgs(args ...string) Option

func WithArgsIncludePrevious

func WithArgsIncludePrevious(includePrevArgs IncludePrevArgs, args ...string) Option

func WithCobraIn

func WithCobraIn(cmd *cobra.Command) Option

func WithCobraOut

func WithCobraOut(cmd CobraOut) Option

func WithCustomIn

func WithCustomIn(in io.Reader) Option

func WithCustomOut

func WithCustomOut(out, err io.Writer) Option

func WithEnv

func WithEnv[E itbasisCoreEnv.ListOrMap](env E) Option

func WithOsPwd

func WithOsPwd() Option

func WithStdIn

func WithStdIn() Option

func WithStdOut

func WithStdOut() Option

func WithWorkDir

func WithWorkDir(dir string) Option

type RestoreOption

type RestoreOption = itbasisCoreOption.RestoreOption[exec.Cmd]

func WithRerun

func WithRerun() RestoreOption

func WithRestoreArgs

func WithRestoreArgs(args ...string) RestoreOption

func WithRestoreArgsIncludePrevious

func WithRestoreArgsIncludePrevious(includePrevArgs IncludePrevArgs, args ...string) RestoreOption

func WithRestoreEnv

func WithRestoreEnv[E itbasisCoreEnv.ListOrMap](env E) RestoreOption

type UnsupportedIncludePrevArgsError

type UnsupportedIncludePrevArgsError struct {
	// contains filtered or unexported fields
}

func (*UnsupportedIncludePrevArgsError) Error

Jump to

Keyboard shortcuts

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