提交 ccef197c 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

test and fix on win7

上级 5c236edb
......@@ -26,17 +26,16 @@ func ExeShell(cmdStr string) (string, error) {
}
func ExecFile(commandName string) string {
// TODO: now tested for linux and mac
commandName = commandName + ";"
var cmd *exec.Cmd
if IsWin() {
cmd = exec.Command("cmd", "/C", commandName)
} else {
commandName = "chmod +x " + commandName + "; " + commandName
commandName = "chmod +x " + commandName + "; " + commandName + ";"
cmd = exec.Command("/bin/bash", "-c", commandName)
}
fmt.Println(commandName)
output := make([]string, 0)
stdout, err := cmd.StdoutPipe()
......@@ -64,7 +63,7 @@ func ExecFile(commandName string) string {
return strings.Join(output, "")
}
func ExecCommandBlock(commandName string) string {
func ExecCommand(commandName string) string {
commandName = "chmod +x " + commandName + "; " + commandName + ";"
cmd := exec.Command("/bin/bash", "-c", commandName)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册