mirror of
https://github.com/containers/podman.git
synced 2025-07-18 01:57:24 +08:00
![dependabot-preview[bot]](/assets/img/avatar_default.png)
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.24.5 to 1.25.0. - [Release notes](https://github.com/containers/storage/releases) - [Changelog](https://github.com/containers/storage/blob/master/docs/containers-storage-changes.md) - [Commits](https://github.com/containers/storage/compare/v1.24.5...v1.25.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
30 lines
502 B
Go
30 lines
502 B
Go
// +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
|
|
}
|