mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-02-06 20:28:39 +01:00
21 lines
523 B
Swift
21 lines
523 B
Swift
import Foundation
|
|
import Path
|
|
|
|
extension Entry {
|
|
var isAppBundle: Bool {
|
|
kind == .directory &&
|
|
path.extension == "app" &&
|
|
!path.isSymlink
|
|
}
|
|
|
|
var infoPlist: InfoPlist? {
|
|
let infoPlistPath = path.join("Contents").join("Info.plist")
|
|
guard
|
|
let infoPlistData = try? Data(contentsOf: infoPlistPath.url),
|
|
let infoPlist = try? PropertyListDecoder().decode(InfoPlist.self, from: infoPlistData)
|
|
else { return nil }
|
|
|
|
return infoPlist
|
|
}
|
|
}
|