Skip to content

Commit

Permalink
better macOS garbage handling
Browse files Browse the repository at this point in the history
  • Loading branch information
kojirou1994 committed Nov 16, 2023
1 parent 87f0886 commit 65f116b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Sources/libChoco/ChocoMuxer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,11 @@ extension ChocoMuxer {
let inputInfo = IOFileInfo(path: currentFileURL)
let startTime = Date()

// macOS resource files
if currentFileURL.lastPathComponent == ".DS_Store" || currentFileURL.lastPathComponent.hasPrefix("._") {
return
}

if options.fileTypes.contains(currentFileURL.pathExtension.lowercased()) {
// remux
let outputResult = self.withTemporaryDirectory { tempDirectory in
Expand All @@ -331,9 +336,6 @@ extension ChocoMuxer {
files.append(.init(input: inputInfo, output: outputResult, timeSummary: .init(startTime: startTime)))
} else {
// copy
if currentFileURL.lastPathComponent == ".DS_Store" {
return
}
if options.copyNormalFiles {
let outputResult: Result<ChocoMuxer.IOFileInfo, ChocoError>
let dstPath = outputDirectoryURL.appendingPathComponent(currentFileURL.lastPathComponent)
Expand Down

0 comments on commit 65f116b

Please sign in to comment.