Skip to content

Commit 75b1e68

Browse files
committed
cmd/update: use short option in update.sh
Support the environment not supporting long option, such as Alpine Linux with busybox.
1 parent d2eb9c4 commit 75b1e68

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Library/Homebrew/cmd/update.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,8 @@ merge_or_rebase() {
211211
if [[ "${DIR}" == "${HOMEBREW_REPOSITORY}" && -n "${HOMEBREW_UPDATE_TO_TAG}" ]]
212212
then
213213
UPSTREAM_TAG="$(
214-
git tag --list |
215-
sort --field-separator=. --key=1,1nr -k 2,2nr -k 3,3nr |
216-
grep --max-count=1 '^[0-9]*\.[0-9]*\.[0-9]*$'
214+
git tag --list --sort=-version:refname |
215+
grep -m 1 '^[0-9]*\.[0-9]*\.[0-9]*$'
217216
)"
218217
else
219218
UPSTREAM_TAG=""

0 commit comments

Comments
 (0)