exec

package
v0.0.0-...-17ef07c Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Thin wrapper for calling system-provided executables.

Useful for augmenting go-git with OS provided git tooling (filter-branch, interpret-trailers, etc).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Output

type Output struct {
	Stderr   io.Reader
	Stdout   io.Reader
	Combined io.Reader
}

func Command

func Command(stdout, stderr, combined io.ReadWriter, exe string, arg ...string) (*exec.Cmd, *Output)

Setup command to capture all outputs.

func Run

func Run(exe string, arg ...string) (*Output, error)

Execute command and capture its output.

func RunWithOutput

func RunWithOutput(stdout, stderr, combined io.ReadWriter, exe string, arg ...string) (*Output, error)

Execute command with provided standard outputs. Useful for piping.

func Script

func Script(cmd [][]string, env ...string) (*Output, error)

Run multiple commands in sequence. Stop at first error.

Returns *Output struct for the last script step that was executed (successful or not).

func ScriptStep

func ScriptStep(arg []string, env ...string) (*Output, error)

Execute a single command verbosely.

func (*Output) All

func (o *Output) All() string

Jump to

Keyboard shortcuts

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