remove more bin bash c

pull/5530/head
Medya Gh 2019-10-28 14:10:22 -07:00
parent e2bbf7111e
commit 29a015b63f
2 changed files with 5 additions and 4 deletions

View File

@ -1035,9 +1035,9 @@ Suggested workarounds:
// Try an HTTPS connection to the
proxy := os.Getenv("HTTPS_PROXY")
opts := "-sS"
opts := []string{"-sS"}
if proxy != "" && !strings.HasPrefix(proxy, "localhost") && !strings.HasPrefix(proxy, "127.0") {
opts = fmt.Sprintf("-x %s %s", proxy, opts)
opts = append([]string{"-x", proxy}, opts...)
}
repo := viper.GetString(imageRepository)
@ -1045,7 +1045,8 @@ Suggested workarounds:
repo = images.DefaultImageRepo
}
if _, err := r.RunCmd(exec.Command("/bin/bash", "-c", fmt.Sprintf("curl %s https://%s/", opts, repo))); err != nil {
opts = append(opts, fmt.Sprintf("https://%s/", repo))
if _, err := r.RunCmd(exec.Command("curl", opts...)); err != nil {
out.WarningT("VM is unable to connect to the selected image repository: {{.error}}", out.V{"error": err})
}
return ip

View File

@ -54,7 +54,7 @@ func getDeleteFileCommand(f assets.CopyableFile) string {
// Command returns a human readable command string that does not induce eye fatigue
func (rr RunResult) Command() string {
var sb strings.Builder
sb.WriteString(strings.TrimPrefix(rr.Args[0], "../../"))
sb.WriteString(rr.Args[0])
for _, a := range rr.Args[1:] {
if strings.Contains(a, " ") {
sb.WriteString(fmt.Sprintf(` "%s"`, a))