ghostty/macos/Sources/Features/About/AboutView.swift
Mitchell Hashimoto 68a23e786d macos: put build numbers back into info.plist, other metadata
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).
2023-12-18 18:56:34 -08:00

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()
}
}