Skip to content

Commit

Permalink
feat: create DestDir if it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkobrombin committed Jul 8, 2024
1 parent e4aeadb commit faa8a03
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/processor/dedup.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ func dedupFinishProcessing(hash string) {

// Process processes the files in the source directory
func (p *DedupProcessor) Process(verbose bool) error {
if p.DestDir != "" {
if verbose {
log.Printf("Creating destination directory: %s", p.DestDir)
}
err := os.MkdirAll(p.DestDir, 0755)
if err != nil {
return fmt.Errorf("creating destination directory: %w", err)
}
}

jobs := make(chan string, p.Workers)
var wg sync.WaitGroup

Expand Down

0 comments on commit faa8a03

Please sign in to comment.