mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-09 08:26:47 +00:00
* Updates containerd to v1.7.0 and new binary for 32-bit Arm OSes. * Updates Go dependencies - openfaas and external Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
30 lines
502 B
Go
Generated
30 lines
502 B
Go
Generated
// +build windows
|
|
|
|
package shellwords
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"os/exec"
|
|
"strings"
|
|
)
|
|
|
|
func shellRun(line, dir string) (string, error) {
|
|
var shell string
|
|
if shell = os.Getenv("COMSPEC"); shell == "" {
|
|
shell = "cmd"
|
|
}
|
|
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
|
|
}
|