exec

package
v0.0.0-...-f2468ff Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2014 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecResponse

type ExecResponse struct {
	Code   int
	Stdout []byte
	Stderr []byte
}

ExecResponse contains the return code and output generated by executing a command.

func RunCommands

func RunCommands(run RunParams) (*ExecResponse, error)

RunCommands executes the Commands specified in the RunParams using powershell on windows, and '/bin/bash -s' on everything else, passing the commands through as stdin, and collecting stdout and stderr. If a non-zero return code is returned, this is collected as the code for the response and this does not classify as an error.

type RunParams

type RunParams struct {
	Commands    string
	WorkingDir  string
	Environment []string
}

Parameters for RunCommands. Commands contains one or more commands to be executed using '/bin/bash -s'. If WorkingDir is set, this is passed through to bash. Similarly if the Environment is specified, this is used for executing the command.

Jump to

Keyboard shortcuts

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