mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-28 05:14:34 +00:00
Check for all bundles instead of just apps.
This commit is contained in:
1 parent
a9e20c7d0a
commit
d81633a7d3
1 file changed
+8
-2
@@ -69,10 +69,16 @@ class ArchiveItem: CustomStringConvertible {
|
||||
.filter({ !$0.hasPrefix(".") })
|
||||
.map({ unarchivedDir.appendingPathComponent($0) })
|
||||
|
||||
let apps = items.filter({ $0.pathExtension == "app" });
|
||||
let apps = items.filter({
|
||||
if let resourceValues = try? $0.resourceValues(forKeys: [URLResourceKey.typeIdentifierKey]) {
|
||||
return UTTypeConformsTo(resourceValues.typeIdentifier! as CFString, kUTTypeBundle)
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
});
|
||||
if apps.count > 0 {
|
||||
if apps.count > 1 {
|
||||
throw makeError(code: .unarchivingError, "Too many apps in \(unarchivedDir.path) \(apps)");
|
||||
throw makeError(code: .unarchivingError, "Too many bundles in \(unarchivedDir.path) \(apps)");
|
||||
}
|
||||
|
||||
let appPath = apps[0];
|
||||
|
||||
Reference in new issue
Block a user