1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 03:50:08 +02:00

🐛 Potential fix for parsing Valet version (#188)

This commit is contained in:
2022-08-24 20:26:32 +02:00
parent a85e016b4a
commit 7587126a42

View File

@ -229,8 +229,19 @@ class Startup {
EnvironmentCheck(
command: {
let output = valet("--version", sudo: false)
// Failure condition #1: does not contain Laravel Valet
if !output.contains("Laravel Valet") {
return true
}
// Failure condition #2: version cannot be parsed
let versionString = output
.trimmingCharacters(in: .whitespacesAndNewlines)
.components(separatedBy: "Laravel Valet")[1]
.trimmingCharacters(in: .whitespaces)
// Extract the version number
Valet.shared.version = VersionExtractor.from(output)
return Valet.shared.version == nil && output.contains("Laravel Valet")
// Get the actual version
return Valet.shared.version == nil
},
name: "`valet --version` was loaded",
titleText: "startup.errors.valet_version_unknown.title".localized,