cmd/update: use short option in update.sh

Support the environment not supporting long option, such as Alpine Linux
with busybox.
This commit is contained in:
chirsz 2025-07-28 18:53:10 +00:00
parent d2eb9c4c21
commit 75b1e681b8

View File

@ -211,9 +211,8 @@ merge_or_rebase() {
if [[ "${DIR}" == "${HOMEBREW_REPOSITORY}" && -n "${HOMEBREW_UPDATE_TO_TAG}" ]]
then
UPSTREAM_TAG="$(
git tag --list |
sort --field-separator=. --key=1,1nr -k 2,2nr -k 3,3nr |
grep --max-count=1 '^[0-9]*\.[0-9]*\.[0-9]*$'
git tag --list --sort=-version:refname |
grep -m 1 '^[0-9]*\.[0-9]*\.[0-9]*$'
)"
else
UPSTREAM_TAG=""