exec

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exec

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

Exec disk implementation.

func New

func New(
	appFs avfs.VFS,
	logger *slog.Logger,
) *Exec

New factory to create a new Exec instance.

func (*Exec) RunCmd

func (e *Exec) RunCmd(
	name string,
	args []string,
) error

RunCmd execute the provided command with args. Yeah, yeah, yeah, I know I cheated by using Exec in this package.

func (*Exec) RunCmdImpl

func (e *Exec) RunCmdImpl(
	name string,
	args []string,
	cwd string,
) error

func (*Exec) RunCmdInDir

func (e *Exec) RunCmdInDir(
	name string,
	args []string,
	cwd string,
) error

func (*Exec) RunInTempDir

func (e *Exec) RunInTempDir(dir, pattern string, fn func(string) error) error

RunInTempDir creates a temporary directory, and runs the provided function with the name of the directory as input. Then it cleans up the temporary directory.

Jump to

Keyboard shortcuts

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