extend/ENV/shared: use try.

`version_suffix` exists (or doesn't) depending on the GCC formula being
available and not loaded from the API.
This commit is contained in:
Mike McQuaid 2023-01-25 16:07:23 +00:00 committed by GitHub
parent b4510401bd
commit 612c27cd2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -289,7 +289,7 @@ module SharedEnvExtension
gcc_version_name = "gcc@#{version}"
gcc = Formulary.factory("gcc")
if gcc.version_suffix == version
if gcc.try(:version_suffix) == version
gcc
else
Formulary.factory(gcc_version_name)