Transform homebrew keys to Integers

What does this merge request do and why?

Homebrew outputs a hash that with the version as a String:

{ 
  "13" => "/usr/local/Cellar/postgresql@13/13.11/bin", 
  "12" => "/usr/local/Cellar/postgresql@12/12.14/bin"
}

However, this script uses an Integer value for target_version and current_version. When it can't find 12 or 13 (since the hash is using "12" and "13"..) it causes the script to fail early due to #check!, and even if you get past that point, it will cause additional issues later on, raising an exception in #initdb_bin and triggering a rollback (due to ensure)

This change transforms the keys to integers, allowing the entire script to flow as expected.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Impacted categories

The following categories relate to this merge request:

Merge request checklist

  • This change is backward compatible. If not, please include steps to communicate to our users.
  • Tests added for new functionality. If not, please raise an issue to follow-up.
  • Documentation added/updated, if needed.
  • Announcement added, if change is notable.
  • gdk doctor test added, if needed.
  • Add the ~highlight label if this MR should be included in the CHANGELOG.md.
Edited by Kerri Miller

Merge request reports

Loading