shell

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandPath added in v0.1.1

func ExpandPath(path string) string

ExpandPath expands a relative or home-relative path to an absolute path.

Types

type Commander

type Commander interface {
	Exec(cmd *exec.Cmd) (string, error)
	ExecSilently(cmd *exec.Cmd) error
}

type DefaultCommander

type DefaultCommander struct {
	Logger *log.Logger
}

func (DefaultCommander) Exec

func (c DefaultCommander) Exec(cmd *exec.Cmd) (string, error)

Exec executes a command and returns its output.

func (DefaultCommander) ExecSilently

func (c DefaultCommander) ExecSilently(cmd *exec.Cmd) error

ExecSilently executes a command without returning its output.

type ShellError

type ShellError struct {
	Command string
	Err     error
}

func (*ShellError) Error

func (e *ShellError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳