cmdrun

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrExitCode1 = errors.New("exit code 1")

Functions

func Run

func Run(
	ctx context.Context, workDir string, cmd string, args ...string,
) (out []byte, err error)

Run runs an arbitrary command and returns (output, ErrExitCode1) if it exits with error code 1, otherwise returns the original error.

func RunTemplWatch

func RunTemplWatch(ctx context.Context, workDir string, st *statetrack.Tracker) error

RunTemplWatch starts `templ generate --log-level debug --watch` and reads its stdout pipe for failure and success logs updating the state accordingly. When ctx is canceled the interrupt signal is sent to the watch process and graceful shutdown is awaited.

func Sh

func Sh(ctx context.Context, workDir string, sh string) (out []byte, err error)

Sh runs an arbitrary shell script and behaves similar to Run.

Types

This section is empty.

Jump to

Keyboard shortcuts

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