xml params

This commit is contained in:
nuknal
2024-05-22 10:33:22 +08:00
parent faf285775f
commit 0634b0106e
6 changed files with 123 additions and 75 deletions

View File

@@ -2,6 +2,7 @@ package extract
import (
"os"
"path/filepath"
)
type Extractor struct {
@@ -10,8 +11,15 @@ type Extractor struct {
}
func NewExtractor(params *Params) *Extractor {
os.MkdirAll(params.OutputPath, 0755)
os.MkdirAll(params.TempPath, 0755)
if err := os.MkdirAll(params.OutputPath, 0755); err != nil {
panic(err)
}
if err := os.MkdirAll(params.TempPath, 0755); err != nil {
panic(err)
}
if err := os.MkdirAll(filepath.Base(params.LogFile), 0755); err != nil {
panic(err)
}
return &Extractor{params: params, Clean: true}
}