cmd

package
v0.0.0-...-e71f8c3 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package cmd is DEPRECATED. Please use github.com/magefile/mage/sh or os/exec directly.

Index

Constants

This section is empty.

Variables

View Source
var (
	RunCommand            = runCommand
	RunCommands           = runCommands
	RunCommandsInParallel = runCommandsInParallel
)

These vars are defined for easy mocking in unit tests.

Functions

This section is empty.

Types

type CommandLineError

type CommandLineError struct {
	Command     string
	ErrorCode   int
	ErrorOutput []byte
}

CommandLineError is a custom error we use for errors got from running commands

func (CommandLineError) Error

func (c CommandLineError) Error() string

type Option

type Option func(cmd *exec.Cmd)

Option enables further configuration of a Cmd.

func WithDir

func WithDir(dir string) Option

WithDir returns an option that adds dir for the given Cmd.

func WithEnvs

func WithEnvs(envs []string) Option

WithEnvs returns an option that adds env vars for the given Cmd.

func WithStdout

func WithStdout() Option

WithStdout returns an option that sets the cmd output to stdout. This redirects output to stdout, should not use this option if you need the return value of the command.

Jump to

Keyboard shortcuts

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