mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-04-25 19:08:39 +03:00

This adds more metadata back into the Info.plist for a build. This metadata is used with the About window. The reason I want the build number back is so that we have a monotonically increasing number to do self-updating with (i.e. Sparkle).
28 lines
853 B
Swift
28 lines
853 B
Swift
import SwiftUI
|
|
|
|
struct AboutView: View {
|
|
/// Read the commit from the bundle.
|
|
var build: String? { Bundle.main.infoDictionary?["CFBundleVersion"] as? String }
|
|
var commit: String? { Bundle.main.infoDictionary?["GhosttyCommit"] as? String }
|
|
var version: String? { Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String }
|
|
|
|
var body: some View {
|
|
VStack(alignment: .center) {
|
|
Image("AppIconImage")
|
|
.resizable()
|
|
.aspectRatio(contentMode: .fit)
|
|
.frame(maxHeight: 96)
|
|
|
|
Text("Ghostty")
|
|
.font(.title3)
|
|
|
|
if let version = self.version {
|
|
Text("Version: \(version)")
|
|
.font(.body)
|
|
}
|
|
}
|
|
.frame(minWidth: 300)
|
|
.padding()
|
|
}
|
|
}
|