update: fix hyphen counting (legacy tap renaming)
Fix regression introduced in fafe8f0f53bf91fc41f016b5c2af41ca712783f7. Counting the number of hyphens in a string cannot be done in a single expression, thus split this and introduce another local variable. Fixes #227.
This commit is contained in:
parent
93e0f4f946
commit
500f9eada8
@ -40,6 +40,7 @@ git_init_if_necessary() {
|
|||||||
rename_taps_dir_if_necessary() {
|
rename_taps_dir_if_necessary() {
|
||||||
local tap_dir
|
local tap_dir
|
||||||
local tap_dir_basename
|
local tap_dir_basename
|
||||||
|
local tap_dir_hyphens
|
||||||
local user
|
local user
|
||||||
local repo
|
local repo
|
||||||
|
|
||||||
@ -55,7 +56,8 @@ rename_taps_dir_if_necessary() {
|
|||||||
mkdir -p "$HOMEBREW_LIBRARY/Taps/$user"
|
mkdir -p "$HOMEBREW_LIBRARY/Taps/$user"
|
||||||
mv "$tap_dir" "$HOMEBREW_LIBRARY/Taps/$user/homebrew-$repo"
|
mv "$tap_dir" "$HOMEBREW_LIBRARY/Taps/$user/homebrew-$repo"
|
||||||
|
|
||||||
if [[ ${#${tap_dir_basename//[^\-]}} -gt 1 ]]
|
tap_dir_hyphens="${tap_dir_basename//[^\-]}"
|
||||||
|
if [[ ${#tap_dir_hyphens} -gt 1 ]]
|
||||||
then
|
then
|
||||||
echo "Homebrew changed the structure of Taps like <someuser>/<sometap>." >&2
|
echo "Homebrew changed the structure of Taps like <someuser>/<sometap>." >&2
|
||||||
echo "So you may need to rename $HOMEBREW_LIBRARY/Taps/$user/homebrew-$repo manually." >&2
|
echo "So you may need to rename $HOMEBREW_LIBRARY/Taps/$user/homebrew-$repo manually." >&2
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user