func getRunCommand(cmd *exec.Cmd) error {
	var buf bytes.Buffer
	cmd.Stdout = &buf
	cmd.Stderr = &buf
	err := cmd.Run()
	if err == nil {
		return nil
	}
	if exiterr, ok := err.(*exec.ExitError); ok {
		if status, ok := exiterr.Sys().(syscall.WaitStatus); ok {
			return fmt.Errorf(
				"%s exited with %d: %s",
				cmd.Path,
				status.ExitStatus(),
				buf.String())
		}
	}
	return fmt.Errorf("error running %s: %s", cmd.Path, buf.String())
}
getRunCommand is a helper that will run a command and capture the output
in the case an error happens.
package getter
import (
	"bytes"
	"fmt"
	"net/url"
	"os/exec"
	"regexp"
	"syscall"
	cleanhttp "github.com/hashicorp/go-cleanhttp"
)
type Getter interface {
	Get(string, *url.URL) error
	GetFile(string, *url.URL) error
	ClientMode(*url.URL) (ClientMode, error)
	SetClient(*Client)
}
var Getters map[string]Getter
var forcedRegexp = regexp.MustCompile(`^([A-Za-z0-9]+)::(.+)$`)
var httpClient = cleanhttp.DefaultClient()
func init() {
	httpGetter := &HttpGetter{
		Netrc: true,
	}
	Getters = map[string]Getter{
		"file":  new(FileGetter),
		"git":   new(GitGetter),
		"hg":    new(HgGetter),
		"s3":    new(S3Getter),
		"http":  httpGetter,
		"https": httpGetter,
	}
}
func Get(dst, src string, opts ...ClientOption) error {
	return (&Client{
		Src:     src,
		Dst:     dst,
		Dir:     true,
		Options: opts,
	}).Get()
}
func GetAny(dst, src string, opts ...ClientOption) error {
	return (&Client{
		Src:     src,
		Dst:     dst,
		Mode:    ClientModeAny,
		Options: opts,
	}).Get()
}
func GetFile(dst, src string, opts ...ClientOption) error {
	return (&Client{
		Src:     src,
		Dst:     dst,
		Dir:     false,
		Options: opts,
	}).Get()
}