exec

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2015 License: Apache-2.0 Imports: 4 Imported by: 14

Documentation

Overview

Package exec runs external commands. It's a wrapper around Go's os/exec package that allows to stub command execution for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultRunner

func DefaultRunner(args []string) error

DefaultRunner is the default function used to run commands. It calls os/exec.Run so that stdout and stderr are written to the terminal. DefaultRunner also logs all executed commands.

func RunCommand

func RunCommand(args []string) error

RunCommand runs the specified command using the currently registered RunnerFunc.

func SetRunnerFunc

func SetRunnerFunc(f RunnerFunc)

SetRunnerFunc registers the function f to run all future commands.

Types

type RunnerFunc

type RunnerFunc func(args []string) error

The RunnerFunc type is an adapter to use any function for running commands.

Jump to

Keyboard shortcuts

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