Skip to content

Commit

Permalink
brew: fixed manual installer packages
Browse files Browse the repository at this point in the history
  • Loading branch information
ciiqr committed Oct 28, 2024
1 parent 8b180e5 commit 4b721f3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions brew/brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ brew::_provision_package() {
declare installed_version
declare latest_version
declare package_info
declare manual_installer
package_info="$(
jq \
--arg 'name' "$package" \
Expand All @@ -29,6 +30,7 @@ brew::_provision_package() {
installed_version="$(jq -r '.installed // empty' <<<"$package_info")" || return "$?"
latest_version="$(jq -r '.version // empty' <<<"$package_info")" || return "$?"
outdated="$(jq -r '.outdated // empty' <<<"$package_info")" || return "$?"
manual_installer="$(jq -r '.artifacts[].installer | select(. != null) | .[].manual // empty' <<<"$package_info")" || return "$?"
fi

# remove _\d$ from $installed_version (it's not there in the latest version, but the versions will otherwise match)
Expand All @@ -50,6 +52,11 @@ brew::_provision_package() {
&& "$installed_version" != "$latest_version" ]]; then
# NOTE: version check because auto_update packages aren't shown as outdated (even that )

# manual installer packages cannot be upgraded
if [[ -n "$manual_installer" ]]; then
return
fi

# update
brew upgrade --no-quarantine "$package" || return "$?"
changed='true'
Expand Down

0 comments on commit 4b721f3

Please sign in to comment.