5 Commits

Author SHA1 Message Date
Martin Afanasjew
eb5d90c1df unlinkapps: avoid deleting too many symlinks
Use `start_with?` to make sure the symlink actually points into one of
the Homebrew directories (depending on given arguments). Previously,
only a substring match was used, which would also remove a symlink to a
hypothetical `/opt/unrelated/usr/local/opt/Unrelated.app`. Even if
unlikely to occur, altering stuff unrelated to Homebrew is bad.

Furthermore, make sure to always use a trailing slash with directories.
Otherwise, e.g., `brew unlinkapps qt` will unlink .app bundles of both
`qt` and `qt5` if both are installed and `brew linkapps qt qt5` was
issued before. (Please ignore that `qt` and `qt5` offer a conflicting
set of .app bundles. This will have to be addressed elsewhere.)

Closes Homebrew/homebrew#45174.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-10-20 08:38:54 +01:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Xu Cheng
fff4b83a52 (un)linkapps: allow unlink/link specific formulae.
Closes Homebrew/homebrew#35080.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-12-19 16:35:45 +00:00
Jack Nagel
10a1952d2c Only "extend self" once on the Homebrew module 2014-06-19 13:10:36 -05:00
Teo Ljungberg
95305e6256 New command: brew unlinkapps
The name is pretty self explanatory, it unlinks all installed
applications found under `brew --prefix` from either `~/Applications` or
`/Applications`

Closes Homebrew/homebrew#22729.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-10-29 21:04:25 -07:00