From d81633a7d37c65889911263fa863072ba3db638f Mon Sep 17 00:00:00 2001 From: Nate Weaver Date: Thu, 24 Jan 2019 11:49:24 -0600 Subject: [PATCH] Check for all bundles instead of just apps. --- generate_appcast/ArchiveItem.swift | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/generate_appcast/ArchiveItem.swift b/generate_appcast/ArchiveItem.swift index e47d9790..90e18134 100644 --- a/generate_appcast/ArchiveItem.swift +++ b/generate_appcast/ArchiveItem.swift @@ -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];