Permalink
Browse files

brew reinstall: Is able to work for all formulae

... and not just installed ones. Of course, strictly speaking,
reinstalling not-yet-installed formulae makes semantically little
sense, but the big win is that we can tell people (after we have
resolved an issue) to `brew reinstall <formula>` and even if a user
has removed that formula in the meantime, reinstall will do the right
thing. Basically adding --force to uninstall. I think this makes
reinstall more robust.
  • Loading branch information...
1 parent 1c13ead commit b3cc4e8c9393d621539ed834c9e9d6f26eb7dc7f @samueljohn samueljohn committed Aug 21, 2013
Showing with 3 additions and 0 deletions.
  1. +3 −0 Library/Homebrew/cmd/reinstall.rb
@@ -6,6 +6,9 @@ def reinstall
# At first save the named formulae and remove them from ARGV
named = ARGV.named
ARGV.delete_if { |arg| named.include? arg }
+ # We add --force because then uninstall always succeeds and so reinstall
+ # works for formulae not yet installed.
+ ARGV << "--force"
clean_ARGV = ARGV.clone
# Add the used_options for each named formula separately so

0 comments on commit b3cc4e8

Please sign in to comment.