sh

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Overview

package sh provides a convenience interface to issue shell commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

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

func New

func New(opts ...RunnerOption) *Runner

func (*Runner) Bash

func (r *Runner) Bash(script ...string) error

func (*Runner) Copy

func (r *Runner) Copy(dst, src string) error

func (*Runner) New

func (r *Runner) New(opts ...RunnerOption) *Runner

func (*Runner) Output

func (r *Runner) Output(cmd string, args ...string) (string, error)

func (*Runner) Run

func (r *Runner) Run(cmd string, args ...string) error

type RunnerOption

type RunnerOption interface {
	ApplyToRunner(r *Runner)
}

type WithCombinedOutput

type WithCombinedOutput struct{ io.Writer }

func (WithCombinedOutput) ApplyToRunner

func (out WithCombinedOutput) ApplyToRunner(r *Runner)

type WithEnvironment

type WithEnvironment map[string]string

func (WithEnvironment) ApplyToRunner

func (e WithEnvironment) ApplyToRunner(r *Runner)

type WithLogger

type WithLogger struct{ *slog.Logger }

func (WithLogger) ApplyToRunner

func (l WithLogger) ApplyToRunner(r *Runner)

type WithStderr

type WithStderr struct{ io.Writer }

func (WithStderr) ApplyToRunner

func (stderr WithStderr) ApplyToRunner(r *Runner)

type WithStdout

type WithStdout struct{ io.Writer }

func (WithStdout) ApplyToRunner

func (stdout WithStdout) ApplyToRunner(r *Runner)

type WithWorkDir

type WithWorkDir string

func (WithWorkDir) ApplyToRunner

func (wd WithWorkDir) ApplyToRunner(r *Runner)

Jump to

Keyboard shortcuts

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