1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-12-23 11:50:07 +01:00

Add early access release notes

This commit is contained in:
2023-03-27 19:37:47 +02:00
parent c5e8c4c4a6
commit 4bca47a6d9
2 changed files with 20 additions and 16 deletions

View File

@@ -86,6 +86,10 @@ struct Constants {
string: "https://phpmon.app/builds/early-access/sponsors/phpmon-eap.rb" string: "https://phpmon.app/builds/early-access/sponsors/phpmon-eap.rb"
)! )!
static let EarlyAccessChangelog = URL(
string: "https://phpmon.app/early-access/release-notes"
)!
} }
} }

View File

@@ -72,7 +72,7 @@ class AppUpdater {
: "brew upgrade phpmon" : "brew upgrade phpmon"
Task { @MainActor in Task { @MainActor in
var alert = BetterAlert().withInformation( BetterAlert().withInformation(
title: "updater.alerts.newer_version_available.title" title: "updater.alerts.newer_version_available.title"
.localized(latestVersionOnline.humanReadable), .localized(latestVersionOnline.humanReadable),
subtitle: "updater.alerts.newer_version_available.subtitle" subtitle: "updater.alerts.newer_version_available.subtitle"
@@ -89,21 +89,21 @@ class AppUpdater {
vc.close(with: .OK) vc.close(with: .OK)
} }
) )
.withSecondary(
if !App.identifier.contains(".phpmon.eap") { text: "updater.alerts.buttons.release_notes".localized,
alert = alert.withSecondary( action: { _ in
text: "updater.alerts.buttons.release_notes".localized, NSWorkspace.shared.open({
action: { _ in if App.identifier.contains(".eap") {
let urlSegments = self.caskFile.url.split(separator: "/") return Constants.Urls.EarlyAccessChangelog
let tag = urlSegments[urlSegments.count - 2] // ../download/{tag}/{file.zip} } else {
NSWorkspace.shared.open( let urlSegments = self.caskFile.url.split(separator: "/")
Constants.Urls.GitHubReleases.appendingPathComponent("/tag/\(tag)") let tag = urlSegments[urlSegments.count - 2] // ../download/{tag}/{file.zip}
) return Constants.Urls.GitHubReleases.appendingPathComponent("/tag/\(tag)")
} }
) }())
} }
)
alert.withTertiary(text: "updater.alerts.buttons.dismiss".localized, action: { vc in .withTertiary(text: "updater.alerts.buttons.dismiss".localized, action: { vc in
vc.close(with: .OK) vc.close(with: .OK)
}) })
.show() .show()