fix: re-examine the language after the build (#1258)

Co-authored-by: Quyc <qyc@QycMacBook-Pro.local>
This commit is contained in:
Quyc 2022-08-03 10:04:05 +08:00 committed by GitHub
parent e501ed3ddd
commit 7d20f254f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,6 +22,7 @@ import (
"context"
"encoding/base64"
"fmt"
"io/ioutil"
"os"
"path"
"runtime"
@ -206,10 +207,19 @@ func (d *SourceCodeParse) Parse() ParseErrorList {
return nil
}
packageFunc :=func() ParseErrorList{
csi.RepositoryURL = buildInfo.RepostoryURL
var checkPath string
checkPath = buildInfo.RepostoryURL
pathSplit := strings.Split(buildInfo.RepostoryURL,"/")
eventID := pathSplit[len(pathSplit)-1]
buildInfo.CodeHome = fmt.Sprintf("/grdata/package_build/temp/events/%s",eventID)
files, err := ioutil.ReadDir(checkPath)
if err != nil {
logrus.Warn("check package error", err)
}
if len(files) == 0 {
// 第一次上传在临时目录下检测
checkPath = fmt.Sprintf("/grdata/package_build/temp/events/%s", eventID)
}
buildInfo.CodeHome = checkPath
return ParseErrorList{}
}
ossFunc := func() ParseErrorList {