mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Filter for archive files in generate_appcast more intelligently (#2448)
This commit is contained in:
2 files changed
+13
-1
No files matched your search
@@ -25,6 +25,7 @@ static NSArray <NSString *> * _Nullable _commandAndArgumentsConformingToTypeOfPa
|
||||
NSArray <NSString *> *extractTBZ = @[@"/usr/bin/tar", @"-jxC"];
|
||||
NSArray <NSString *> *extractTXZ = extractTGZ;
|
||||
|
||||
// Note: keep this list in sync with generate_appcast's unarchiveUpdates()
|
||||
NSDictionary <NSString *, NSArray<NSString *> *> *extractCommandDictionary =
|
||||
@{
|
||||
@".zip" : @[@"/usr/bin/ditto", @"-x",@"-k",@"-"],
|
||||
|
||||
@@ -56,7 +56,18 @@ func unarchiveUpdates(archivesSourceDir: URL, archivesDestDir: URL, disableNeste
|
||||
// so we can ignore duplicate archive entries before trying to unarchive archives in parallel
|
||||
var fileEntries: [URL: URL] = [:]
|
||||
let dir = try fileManager.contentsOfDirectory(atPath: archivesSourceDir.path)
|
||||
for item in dir.filter({ !$0.hasPrefix(".") && !$0.hasSuffix(".delta") && !$0.hasSuffix(".xml") && !$0.hasSuffix(".html") && !$0.hasSuffix(".txt") }) {
|
||||
for item in dir {
|
||||
if item.hasPrefix(".") {
|
||||
continue
|
||||
}
|
||||
|
||||
let itemURL = archivesSourceDir.appendingPathComponent(item)
|
||||
let fileExtension = itemURL.pathExtension
|
||||
// Note: keep this list in sync with SUPipedUnarchiver
|
||||
guard ["zip", "tar", "gz", "tgz", "bz2", "tbz", "xz", "txz", "lzma", "dmg"].contains(fileExtension) else {
|
||||
continue
|
||||
}
|
||||
|
||||
let itemPath = archivesSourceDir.appendingPathComponent(item)
|
||||
|
||||
// Ignore directories
|
||||
|
||||
Reference in new issue
Block a user