fix: preview of xcarchive for non app-like bundles
This commit is contained in:
@@ -5,8 +5,8 @@
|
|||||||
<style>__CSS__</style>
|
<style>__CSS__</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<h1>__QuickLookTitle__</h1>
|
||||||
<div class="app __AppInfoHidden__">
|
<div class="app __AppInfoHidden__">
|
||||||
<h1>__QuickLookTitle__</h1>
|
|
||||||
<div class="floatLeft icon"><img alt="App icon" src="data:image/png;base64,__AppIcon__"/></div>
|
<div class="floatLeft icon"><img alt="App icon" src="data:image/png;base64,__AppIcon__"/></div>
|
||||||
<div class="floatLeft info">
|
<div class="floatLeft info">
|
||||||
Name: <strong>__AppName__</strong><br />
|
Name: <strong>__AppName__</strong><br />
|
||||||
|
|||||||
@@ -38,11 +38,11 @@ struct MetaInfo {
|
|||||||
case "com.apple.xcode.archive":
|
case "com.apple.xcode.archive":
|
||||||
self.type = FileType.Archive
|
self.type = FileType.Archive
|
||||||
let productsDir = url.appendingPathComponent("Products", isDirectory: true)
|
let productsDir = url.appendingPathComponent("Products", isDirectory: true)
|
||||||
if productsDir.exists() {
|
if productsDir.exists(), let bundleDir = recursiveSearchInfoPlist(productsDir) {
|
||||||
if let bundleDir = recursiveSearchInfoPlist(productsDir) {
|
isOSX = bundleDir.appendingPathComponent("MacOS").exists() && bundleDir.lastPathComponent == "Contents"
|
||||||
isOSX = bundleDir.appendingPathComponent("MacOS").exists() && bundleDir.lastPathComponent == "Contents"
|
effective = bundleDir
|
||||||
effective = bundleDir
|
} else {
|
||||||
}
|
effective = productsDir // this is wrong but dont use `url` either because that will find the `Info.plist` of the archive itself
|
||||||
}
|
}
|
||||||
case "com.apple.application-and-system-extension":
|
case "com.apple.application-and-system-extension":
|
||||||
self.type = FileType.Extension
|
self.type = FileType.Extension
|
||||||
@@ -116,6 +116,9 @@ private func recursiveSearchInfoPlist(_ url: URL) -> URL? {
|
|||||||
var queue: [URL] = [url]
|
var queue: [URL] = [url]
|
||||||
while !queue.isEmpty {
|
while !queue.isEmpty {
|
||||||
let current = queue.removeLast()
|
let current = queue.removeLast()
|
||||||
|
if current.pathExtension == "framework" {
|
||||||
|
continue // do not evaluate bundled frameworks
|
||||||
|
}
|
||||||
if let subfiles = try? FileManager.default.contentsOfDirectory(at: current, includingPropertiesForKeys: []) {
|
if let subfiles = try? FileManager.default.contentsOfDirectory(at: current, includingPropertiesForKeys: []) {
|
||||||
for fname in subfiles {
|
for fname in subfiles {
|
||||||
if fname.lastPathComponent == "Info.plist" {
|
if fname.lastPathComponent == "Info.plist" {
|
||||||
|
|||||||
Reference in New Issue
Block a user