ci speedup

This commit is contained in:
yusing
2024-09-29 06:00:52 +08:00
parent 91e7f4894a
commit e2b08d8667
9 changed files with 47 additions and 12 deletions

View File

@@ -76,6 +76,10 @@ func main() {
return
}
for _, dir := range common.RequiredDirectories {
prepareDirectory(dir)
}
err := config.Load()
if err != nil {
logrus.Warn(err)
@@ -188,6 +192,14 @@ func main() {
}
}
func prepareDirectory(dir string) {
if _, err := os.Stat(dir); os.IsNotExist(err) {
if err = os.MkdirAll(dir, 0755); err != nil {
logrus.Fatalf("failed to create directory %s: %v", dir, err)
}
}
}
func funcName(f func()) string {
parts := strings.Split(runtime.FuncForPC(reflect.ValueOf(f).Pointer()).Name(), "/go-proxy/")
return parts[len(parts)-1]