from vscode

This commit is contained in:
zeaslity
2023-11-13 10:25:15 +08:00
parent cdfa4b5d04
commit 3f06350089
8 changed files with 42 additions and 30 deletions

View File

@@ -185,7 +185,7 @@ func PureResultSingleExecuteBatch(singleCommandList [][]string) (resultOK bool)
}
// ReadTimeCommandExecutor 执行命令,并且实时返回结果
func ReadTimeCommandExecutor(singleLineCommand []string) {
func ReadTimeCommandExecutor(singleLineCommand []string) bool {
cmd := exec.Command(singleLineCommand[0], singleLineCommand[1:]...)
stdout, err := cmd.StdoutPipe()
if err != nil {
@@ -205,8 +205,10 @@ func ReadTimeCommandExecutor(singleLineCommand []string) {
if err := cmd.Wait(); err != nil {
log.ErrorF("command %v result error => %v", singleLineCommand, err)
return false
}
return true
}
func realTimeOutput(r io.Reader) {