shell

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package shell wraps shell execution

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompletedProcess

type CompletedProcess struct {
	Name       string
	Args       []string
	ReturnCode int
	Stdout     string
	Stderr     string
}

CompletedProcess represents a subshell execution that finished, and includes its arguments, return code, and standard buffers as strings.

type Shell

type Shell interface {
	NewCommand(program string, args ...string) *exec.Cmd
	Exec(cmd *exec.Cmd) (*CompletedProcess, error)
	Exists(program string) bool
	CurrentDirectory() string
}

Shell is an abstraction for shell-program execution meant to make testing and client design easier.

func New

func New(ctx *context.Context) Shell

New returns a new shell bound to the provided context.

Jump to

Keyboard shortcuts

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