зеркало из https://github.com/microsoft/docker.git
18 строки
317 B
Go
18 строки
317 B
Go
package shellwords
|
|
|
|
import (
|
|
"errors"
|
|
"os"
|
|
"os/exec"
|
|
"strings"
|
|
)
|
|
|
|
func shellRun(line string) (string, error) {
|
|
shell := os.Getenv("COMSPEC")
|
|
b, err := exec.Command(shell, "/c", line).Output()
|
|
if err != nil {
|
|
return "", errors.New(err.Error() + ":" + string(b))
|
|
}
|
|
return strings.TrimSpace(string(b)), nil
|
|
}
|