fix: escape windows commands

This commit is contained in:
Lea Anthony
2019-10-25 16:44:46 +11:00
parent f5d3fb0848
commit 11f805a97f

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"os/exec"
"path/filepath"
"runtime"
"strings"
"syscall"
)
@@ -128,6 +129,11 @@ func (p *ProgramHelper) RunCommandArray(args []string, dir ...string) error {
fmt.Printf("ERROR: Looks like '%s' isn't installed. Please install and try again.", program)
return err
}
if runtime.GOOS == "windows" {
program = strings.ReplaceAll(program, ` `, `\ `)
}
args = args[1:]
var stderr string
var stdout string