mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Keg: only instantiate Keg.for if target exists
This commit is contained in:
parent
66f0a35587
commit
a2e0da89e4
@ -651,7 +651,7 @@ class Keg
|
|||||||
# formula. The `AlreadyLinkedError` above won't catch
|
# formula. The `AlreadyLinkedError` above won't catch
|
||||||
# this if a formula is missing an optlink. In that case,
|
# this if a formula is missing an optlink. In that case,
|
||||||
# delete the symlink and retry.
|
# delete the symlink and retry.
|
||||||
if dst.symlink? && Keg.for(dst).name == name
|
if dst.symlink? && dst.exist? && Keg.for(dst).name == name
|
||||||
dst.unlink
|
dst.unlink
|
||||||
retry
|
retry
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user