提交 c4932ee9 编写于 作者: 雨爱无痕

Fix issue.

上级 805ac832
......@@ -26,12 +26,12 @@ import (
)
func ExecCases(ch chan int, testSet serverDomain.TestSet, msg *websocket.Message) (report commDomain.ZtfReport, pathMaxWidth int, err error) {
if testSet.Cmd != "" {
err = execCmd(testSet.Cmd, testSet.WorkspacePath)
if err != nil {
return
}
}
// if testSet.Cmd != "" {
// err = execCmd(testSet.Cmd, testSet.WorkspacePath)
// if err != nil {
// return
// }
// }
return RunZtf(ch, testSet.WorkspacePath, 0, 0, commConsts.Case, testSet.Cases, msg)
}
......
......@@ -400,6 +400,9 @@ func ScriptToExpectName(file string) string {
}
func getScriptComments(content, lang string) (ret string) {
if lang == "" {
return
}
reg := fmt.Sprintf(`(?smU)%s((?U:.*))%s`, commConsts.LangCommentsRegxMap[lang][0], commConsts.LangCommentsRegxMap[lang][1])
arr := regexp.MustCompile(reg).FindStringSubmatch(content)
if len(arr) < 2 { // wrong format
......
......@@ -64,7 +64,7 @@ func (s *JobService) Start(po *model.Job) {
s.JobRepo.UpdateStatus(po, commConsts.JobInprogress, true, false)
if po.Cmd != "" {
shellUtils.ExeShellWithOutput(po.Cmd)
shellUtils.ExeShellWithOutputInDir(po.Cmd, po.Workspace)
}
err := execHelper.Exec(nil, req, nil)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册