linkapps: overwrite broken app symlinks
Closes Homebrew/homebrew#22388. Closes Homebrew/homebrew#22430. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
parent
0b958ed607
commit
42faf1a860
@ -20,13 +20,11 @@ HOMEBREW_CELLAR.subdirs.each do |rack|
|
||||
app_name = File.basename(app)
|
||||
target = "#{TARGET_DIR}/#{app_name}"
|
||||
|
||||
if File.exist?(target) && File.symlink?(target)
|
||||
system "rm", target
|
||||
elsif File.exist?(target)
|
||||
if File.exist?(target) && !File.symlink?(target)
|
||||
onoe "#{target} already exists, skipping."
|
||||
next
|
||||
end
|
||||
system "ln", "-s", app, TARGET_DIR
|
||||
system "ln", "-sf", app, TARGET_DIR
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user