Merge pull request #14667 from carlocab/update-reset-tap-names

cmd/update-reset: improve arg parsing
This commit is contained in:
Carlo Cabrera 2023-02-28 22:05:10 +08:00 committed by GitHub
commit 1201f18db0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -105,8 +105,6 @@ jobs:
brew tap homebrew/portable-ruby brew tap homebrew/portable-ruby
brew tap homebrew/services brew tap homebrew/services
brew update-reset Library/Taps/homebrew/homebrew-bundle
# brew style doesn't like world writable directories # brew style doesn't like world writable directories
sudo chmod -R g-w,o-w "$(brew --repo)/Library/Taps" sudo chmod -R g-w,o-w "$(brew --repo)/Library/Taps"

View File

@ -1,4 +1,4 @@
#: * `update-reset` [<repository> ...] #: * `update-reset` [<path-to-tap-repository> ...]
#: #:
#: Fetch and reset Homebrew and all tap repositories (or any specified <repository>) using `git`(1) to their latest `origin/HEAD`. #: Fetch and reset Homebrew and all tap repositories (or any specified <repository>) using `git`(1) to their latest `origin/HEAD`.
#: #:
@ -33,7 +33,14 @@ homebrew-update-reset() {
[[ "${option}" == *d* ]] && HOMEBREW_DEBUG=1 [[ "${option}" == *d* ]] && HOMEBREW_DEBUG=1
;; ;;
*) *)
if [[ -d "${option}/.git" ]]
then
REPOS+=("${option}") REPOS+=("${option}")
else
onoe "${option} is not a Git repository!"
brew help update-reset
exit 1
fi
;; ;;
esac esac
done done