cmd/update-reset: accept tap names as arguments
Currently, doing `brew update-reset homebrew/core` does nothing (not
even return an error). If you want to `update-reset` a given tap, you
must do (the equivalent of)
brew update-reset "$(brew --repository owner/tap_name)"
This isn't very intuitive, so let's do a bit more work in argument
parsing so that the user can just pass a tap name instead of a path to a
tap.
Passing a path to a tap is also still supported.
This commit is contained in:
parent
17c872fb52
commit
ac7dbc0082
@ -33,7 +33,22 @@ homebrew-update-reset() {
|
|||||||
[[ "${option}" == *d* ]] && HOMEBREW_DEBUG=1
|
[[ "${option}" == *d* ]] && HOMEBREW_DEBUG=1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
REPOS+=("${option}")
|
if [[ -d "${option}" ]]
|
||||||
|
then
|
||||||
|
REPOS+=("${option}")
|
||||||
|
else
|
||||||
|
local owner="${option%/*}"
|
||||||
|
local name="${option#*/}"
|
||||||
|
name="${name#homebrew-}" # Support both homebrew/core and homebrew/homebrew-core.
|
||||||
|
|
||||||
|
local repo_path="${HOMEBREW_LIBRARY}/Taps/${owner}/homebrew-${name}"
|
||||||
|
if [[ -d "${repo_path}" ]]
|
||||||
|
then
|
||||||
|
REPOS+=("${repo_path}")
|
||||||
|
else
|
||||||
|
odie "Could not find tap: ${option}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user