mirror of
https://github.com/containers/podman.git
synced 2025-06-16 06:29:16 +08:00
migrate to go-modules
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
22
vendor/github.com/mattn/go-shellwords/util_posix.go
generated
vendored
Normal file
22
vendor/github.com/mattn/go-shellwords/util_posix.go
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// +build !windows,go1.6
|
||||
|
||||
package shellwords
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func shellRun(line string) (string, error) {
|
||||
shell := os.Getenv("SHELL")
|
||||
b, err := exec.Command(shell, "-c", line).Output()
|
||||
if err != nil {
|
||||
if eerr, ok := err.(*exec.ExitError); ok {
|
||||
b = eerr.Stderr
|
||||
}
|
||||
return "", errors.New(err.Error() + ":" + string(b))
|
||||
}
|
||||
return strings.TrimSpace(string(b)), nil
|
||||
}
|
Reference in New Issue
Block a user