修正 #59 #99 转换后移除原始文件处理 #100

Merged
lsr merged 6 commits from fix-59-99-remove-source into main 2024-10-08 21:06:45 +00:00
Showing only changes of commit 36df203bdd - Show all commits

View File

@ -231,6 +231,8 @@ func (p *processor) processDir(inputDir string) error {
if err != nil {
return err
}
var lastError error = nil
for _, item := range items {
if item.IsDir() {
continue
@ -238,9 +240,13 @@ func (p *processor) processDir(inputDir string) error {
filePath := filepath.Join(inputDir, item.Name())
if err := p.processFile(filePath); err != nil {
lastError = err
logger.Error("conversion failed", zap.String("source", item.Name()), zap.Error(err))
}
}
if lastError != nil {
return fmt.Errorf("last error: %w", lastError)
}
return nil
}