优化 代码

This commit is contained in:
dengsgo 2019-01-03 10:27:04 +08:00
parent 92af817777
commit 27f934d6fb
2 changed files with 4 additions and 3 deletions

View File

@ -17,7 +17,7 @@ const (
) )
var ( var (
projectFolder string = "." projectFolder = "."
cfg *FileGirl cfg *FileGirl

View File

@ -2,6 +2,7 @@ package main
import ( import (
"bufio" "bufio"
"fmt"
"io" "io"
"log" "log"
"os" "os"
@ -60,7 +61,7 @@ func (t *TaskMan) run(cf *changedFile) {
defer t.runLock.Unlock() defer t.runLock.Unlock()
for i := 0; i < len(cfg.Command.Exec); i++ { for i := 0; i < len(cfg.Command.Exec); i++ {
carr := cmdParse2Array(cfg.Command.Exec[i], cf) carr := cmdParse2Array(cfg.Command.Exec[i], cf)
log.Println(carr) log.Println("EXEC", carr)
t.cmd = exec.Command(carr[0], carr[1:]...) t.cmd = exec.Command(carr[0], carr[1:]...)
//cmd.SysProcAttr = &syscall.SysProcAttr{CreationFlags: syscall.CREATE_UNICODE_ENVIRONMENT} //cmd.SysProcAttr = &syscall.SysProcAttr{CreationFlags: syscall.CREATE_UNICODE_ENVIRONMENT}
t.cmd.Stdin = os.Stdin t.cmd.Stdin = os.Stdin
@ -80,7 +81,7 @@ func (t *TaskMan) run(cf *changedFile) {
if err2 != nil || io.EOF == err2 { if err2 != nil || io.EOF == err2 {
break break
} }
log.Print(line) fmt.Print(line)
} }
err = t.cmd.Wait() err = t.cmd.Wait()
if err != nil { if err != nil {