mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-08 04:20:07 +02:00
👌 Improved PHP version filter
This commit is contained in:
@ -605,7 +605,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = "3.3-prerelease4";
|
MARKETING_VERSION = 3.3;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon;
|
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@ -629,7 +629,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/../Frameworks",
|
"@executable_path/../Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = "3.3-prerelease4";
|
MARKETING_VERSION = 3.3;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon;
|
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
@ -24,10 +24,18 @@ class Actions {
|
|||||||
|
|
||||||
// Get a list of versions only
|
// Get a list of versions only
|
||||||
var versionsOnly : [String] = []
|
var versionsOnly : [String] = []
|
||||||
versions.forEach { (string) in
|
versions.filter { (version) -> Bool in
|
||||||
|
// Omit everything that doesn't start with php@
|
||||||
|
// (e.g. something-php@8.0 won't be detected)
|
||||||
|
return version.starts(with: "php@")
|
||||||
|
}.forEach { (string) in
|
||||||
let version = string.components(separatedBy: "php@")[1]
|
let version = string.components(separatedBy: "php@")[1]
|
||||||
// Only append the version if it doesn't already exist (avoid dupes)
|
// Only append the version if it doesn't already exist (avoid dupes),
|
||||||
if !versionsOnly.contains(version) && Constants.SupportedPhpVersions.contains(version) {
|
// is supported and where the binary exists (avoids broken installs)
|
||||||
|
if !versionsOnly.contains(version)
|
||||||
|
&& Constants.SupportedPhpVersions.contains(version)
|
||||||
|
&& Shell.fileExists("\(Paths.optPath)/php@\(version)/bin/php")
|
||||||
|
{
|
||||||
versionsOnly.append(version)
|
versionsOnly.append(version)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -42,6 +50,8 @@ class Actions {
|
|||||||
versionsOnly.append(phpAlias);
|
versionsOnly.append(phpAlias);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print("The PHP versions that were detected are: \(versionsOnly)")
|
||||||
|
|
||||||
return versionsOnly
|
return versionsOnly
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user