diff --git a/pkgs/by-name/_1/_1password-gui/update.sh b/pkgs/by-name/_1/_1password-gui/update.sh index 07fc726e2f74..b4a2fb91f1f2 100755 --- a/pkgs/by-name/_1/_1password-gui/update.sh +++ b/pkgs/by-name/_1/_1password-gui/update.sh @@ -37,6 +37,7 @@ read_local_versions() { read_remote_versions() { local channel="$1" + local darwin_beta_maybe if [[ ${channel} == "stable" ]]; then remote_versions["stable/linux"]=$( @@ -56,10 +57,17 @@ read_remote_versions() { | "${JQ[@]}" '.[] | select(.repo == "aur" and .srcname == "1password-beta") | .version | sub("_"; "-")' ) - remote_versions["beta/darwin"]=$( + # Handle macOS Beta app-update feed quirk. + # If there is a newer release in the stable channel, queries for beta + # channel will return the stable channel version; masking the current beta. + darwin_beta_maybe=$( "${CURL[@]}" "${APP_UPDATES_URI_BASE}/Y" \ | "${JQ[@]}" 'select(.available == "1") | .version' ) + # Only consider versions that end with '.BETA' + if [[ ${darwin_beta_maybe} =~ \.BETA$ ]]; then + remote_versions["beta/darwin"]=${darwin_beta_maybe} + fi fi } @@ -98,9 +106,12 @@ for i in "${!remote_versions[@]}"; do fi done -if [[ ${#new_version_available[@]} -eq 0 ]]; then - # up to date - exit +num_updates=${#new_version_available[@]} +if (( num_updates == 0 )); then + exit # up to date +elif (( num_updates == 1 )); then + os=$(cut -d / -f 2 <<<"${new_version_available[@]}") + os_specific_update=" (${os} only)" fi ./update-sources.py "${new_version_available[@]}" @@ -109,7 +120,7 @@ cat <