mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-07 03:50:08 +02:00
✨ Indicate DEV builds in PHP Version Manager
This commit is contained in:
@ -14,6 +14,8 @@ class PhpInstallation {
|
|||||||
|
|
||||||
var iniFiles: [PhpConfigurationFile] = []
|
var iniFiles: [PhpConfigurationFile] = []
|
||||||
|
|
||||||
|
var isPreRelease: Bool = false
|
||||||
|
|
||||||
var isMissingBinary: Bool = false
|
var isMissingBinary: Bool = false
|
||||||
|
|
||||||
var isHealthy: Bool = true
|
var isHealthy: Bool = true
|
||||||
@ -59,6 +61,10 @@ class PhpInstallation {
|
|||||||
trimNewlines: false
|
trimNewlines: false
|
||||||
).trimmingCharacters(in: .whitespacesAndNewlines)
|
).trimmingCharacters(in: .whitespacesAndNewlines)
|
||||||
|
|
||||||
|
if longVersionString.contains("-dev") {
|
||||||
|
isPreRelease = true
|
||||||
|
}
|
||||||
|
|
||||||
// The parser should always work, or the string has to be very unusual.
|
// The parser should always work, or the string has to be very unusual.
|
||||||
// If so, the app SHOULD crash, so that the users report what's up.
|
// If so, the app SHOULD crash, so that the users report what's up.
|
||||||
versionNumber = try! VersionNumber.parse(longVersionString)
|
versionNumber = try! VersionNumber.parse(longVersionString)
|
||||||
|
@ -46,12 +46,17 @@ class BrewPhpFormulaeHandler: HandlesBrewPhpFormulae {
|
|||||||
return Brew.phpVersionFormulae.map { (version, formula) in
|
return Brew.phpVersionFormulae.map { (version, formula) in
|
||||||
var fullVersion: String?
|
var fullVersion: String?
|
||||||
var upgradeVersion: String?
|
var upgradeVersion: String?
|
||||||
|
var isPrerelease: Bool = Constants.ExperimentalPhpVersions.contains(version)
|
||||||
|
|
||||||
if let install = PhpEnvironments.shared.cachedPhpInstallations[version] {
|
if let install = PhpEnvironments.shared.cachedPhpInstallations[version] {
|
||||||
fullVersion = install.versionNumber.text
|
fullVersion = install.versionNumber.text
|
||||||
|
fullVersion = install.isPreRelease ? "\(fullVersion!)-dev" : fullVersion
|
||||||
|
|
||||||
upgradeVersion = outdated?.first(where: { formula in
|
upgradeVersion = outdated?.first(where: { formula in
|
||||||
return formula.name == install.formulaName
|
return formula.name == install.formulaName
|
||||||
})?.current_version
|
})?.current_version
|
||||||
|
|
||||||
|
isPrerelease = install.isPreRelease
|
||||||
}
|
}
|
||||||
|
|
||||||
return BrewPhpFormula(
|
return BrewPhpFormula(
|
||||||
@ -59,7 +64,7 @@ class BrewPhpFormulaeHandler: HandlesBrewPhpFormulae {
|
|||||||
displayName: "PHP \(version)",
|
displayName: "PHP \(version)",
|
||||||
installedVersion: fullVersion,
|
installedVersion: fullVersion,
|
||||||
upgradeVersion: upgradeVersion,
|
upgradeVersion: upgradeVersion,
|
||||||
prerelease: Constants.ExperimentalPhpVersions.contains(version)
|
prerelease: isPrerelease
|
||||||
)
|
)
|
||||||
}.sorted { $0.displayName > $1.displayName }
|
}.sorted { $0.displayName > $1.displayName }
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user