{"modulePath":"github.com/fossas/fossa-cli","version":"v1.1.10","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package exec\n\n## Functions\n\n```go\nfunc BuildExec(cmd Cmd) (*exec.Cmd, *bytes.Buffer)\n```\nBuildExec translates FOSSA exec structures into standard library exec commands.\n\n```go\nfunc Run(cmd Cmd) (string, string, error)\n```\nRun executes a \\`Cmd\\`, retries the specified amount, and checks for command timeout if specified.\n\n```go\nfunc Shell(cmd Cmd) (stdout, stderr string, err error)\n```\n\n```go\nfunc Which(arg string, cmds ...string) (cmd string, output string, err error)\n```\nWhich picks a command out of a list of candidates.\n\n```go\nfunc WhichArgs(argv []string, cmds ...string) (cmd string, output string, err error)\n```\nWhichArgs is \\`Which\\` but passes multiple arguments to each candidate. The default timeout is set to 5 minutes to kill hanging commands.\n\n```go\nfunc WhichWithResolver(cmds []string, resolve WhichResolver) (string, string, error)\n```\nWhichWithResolver is \\`Which\\` with a custom resolution strategy.\n\n## Types\n\n```go\ntype Cmd struct {\n\tName    string   // Executable name.\n\tArgv    []string // Executable arguments.\n\tCommand string   // Shell command.\n\tDir     string   // The Command's working directory.\n\n\tTimeout string // Specifies the amount of time a command is allowed to run.\n\tRetries int    // Amount of times a command can be retried.\n\n\t// If neither Env nor WithEnv are set, the environment is inherited from os.Environ().\n\tEnv     map[string]string // If set, the command's environment is _set_ to Env.\n\tWithEnv map[string]string // If set, the command's environment is _added_ to WithEnv.\n}\n```\nCmd represents a single command. If Name and Argv are set, this is treated as an executable. If Command is set, this is treated as a shell command.\n\n```go\ntype WhichResolver func(cmd string) (output string, ok bool, err error)\n```\nA WhichResolver takes a candidate command and returns whether to choose it.\n\n","path":"github.com/fossas/fossa-cli/exec","name":"exec","synopsis":"","isRedistributable":true}
