aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2017-04-05 09:00:11 +0100
committerGitHub2017-04-05 09:00:11 +0100
commit2144c35539318a8ec88ba3ebcca473a917eee71b (patch)
treec9d4a52eb897bef74b43fe69f0c8b39f8fd4de9b /Library
parent3b75075727786eb4f02b25a49d178f3b4a23708b (diff)
downloadbrew-2144c35539318a8ec88ba3ebcca473a917eee71b.tar.bz2
keg_relocate: slim long lines.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/keg_relocate.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/keg_relocate.rb b/Library/Homebrew/keg_relocate.rb
index 4ec913642..6044426ee 100644
--- a/Library/Homebrew/keg_relocate.rb
+++ b/Library/Homebrew/keg_relocate.rb
@@ -16,7 +16,9 @@ class Keg
link = file.readlink
# Don't fix relative symlinks
next unless link.absolute?
- next unless link.to_s.start_with?(HOMEBREW_CELLAR.to_s) || link.to_s.start_with?(HOMEBREW_PREFIX.to_s)
+ link_starts_cellar = link.to_s.start_with?(HOMEBREW_CELLAR.to_s)
+ link_starts_prefix = link.to_s.start_with?(HOMEBREW_PREFIX.to_s)
+ next if !link_starts_cellar && !link_starts_prefix
new_src = link.relative_path_from(file.parent)
file.unlink
FileUtils.ln_s(new_src, file)