diff options
| author | Martin Afanasjew | 2016-05-09 20:57:40 +0200 |
|---|---|---|
| committer | Martin Afanasjew | 2016-05-09 21:00:26 +0200 |
| commit | 500f9eada854c1939bf9a0caf94085214c9399b0 (patch) | |
| tree | 9e6aa6a347cd540368f308c0d0ec757c45b57629 /Library/Homebrew | |
| parent | 93e0f4f9465978460d411f27214e19ae3fc4d294 (diff) | |
| download | brew-500f9eada854c1939bf9a0caf94085214c9399b0.tar.bz2 | |
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.
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/cmd/update.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 44a6ebdf4..9679c0f8e 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -40,6 +40,7 @@ git_init_if_necessary() { rename_taps_dir_if_necessary() { local tap_dir local tap_dir_basename + local tap_dir_hyphens local user local repo @@ -55,7 +56,8 @@ rename_taps_dir_if_necessary() { mkdir -p "$HOMEBREW_LIBRARY/Taps/$user" 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 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 |
