Use compose-spec parser

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2021-07-12 11:20:43 +02:00
parent 67bd6f4dc8
commit ba443811e4
64 changed files with 5883 additions and 1331 deletions

29
vendor/github.com/mattn/go-shellwords/util_posix.go generated vendored Normal file
View File

@ -0,0 +1,29 @@
// +build !windows
package shellwords
import (
"fmt"
"os"
"os/exec"
"strings"
)
func shellRun(line, dir string) (string, error) {
var shell string
if shell = os.Getenv("SHELL"); shell == "" {
shell = "/bin/sh"
}
cmd := exec.Command(shell, "-c", line)
if dir != "" {
cmd.Dir = dir
}
b, err := cmd.Output()
if err != nil {
if eerr, ok := err.(*exec.ExitError); ok {
b = eerr.Stderr
}
return "", fmt.Errorf("%s: %w", string(b), err)
}
return strings.TrimSpace(string(b)), nil
}