mirror of
https://github.com/containers/podman.git
synced 2025-06-16 06:29:16 +08:00

This requires updating all import paths throughout, and a matching buildah update to interoperate. I can't figure out the reason for go.mod tracking github.com/containers/image v3.0.2+incompatible // indirect ((go mod graph) lists it as a direct dependency of libpod, but (go list -json -m all) lists it as an indirect dependency), but at least looking at the vendor subdirectory, it doesn't seem to be actually used in the built binaries. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
30 lines
479 B
Go
30 lines
479 B
Go
// +build !go1.6
|
|
|
|
package shellwords
|
|
|
|
import (
|
|
"os"
|
|
"os/exec"
|
|
"runtime"
|
|
"strings"
|
|
)
|
|
|
|
func shellRun(line, dir string) (string, error) {
|
|
var b []byte
|
|
var err error
|
|
var cmd *exec.Cmd
|
|
if runtime.GOOS == "windows" {
|
|
cmd = exec.Command(os.Getenv("COMSPEC"), "/c", line)
|
|
} else {
|
|
cmd = exec.Command(os.Getenv("SHELL"), "-c", line)
|
|
}
|
|
if dir != "" {
|
|
cmd.Dir = dir
|
|
}
|
|
b, err = cmd.Output()
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return strings.TrimSpace(string(b)), nil
|
|
}
|