1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 03:50:08 +02: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"
)!
static let EarlyAccessChangelog = URL(
string: "https://phpmon.app/early-access/release-notes"
)!
}
}

View File

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