17 Commits

Author SHA1 Message Date
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
Mike McQuaid
01e9ec9a9f Rubocop: automatic rule fixes. 2017-09-24 21:23:59 +01:00
Markus Reiter
c594ffefbc Add Formatter::pluralize. 2017-03-11 21:12:51 +01:00
Mike McQuaid
f5b63f4a8d Deprecate brew (un)linkapps.
Unfortunately `brew linkapps` cannot behave nicely with e.g. Spotlight
using either aliases or symlinks and Homebrew formulae do not build
"proper" `.app` bundles that can be relocated. Instead, please consider
using `brew cask` and migrate formulae using `.app`s to casks.
2017-01-09 14:10:26 +00:00
Markus Reiter
c36f42ce95 Remove private_class_method from commands. 2016-10-02 00:24:47 +02:00
Markus Reiter
0ab750bf24 Use module_function for commands. 2016-10-02 00:24:47 +02:00
Mike McQuaid
3982950e61 rubocop --auto-correct all hash-rocket usage. 2016-09-17 16:14:13 +01:00
Mike McQuaid
7b41ccd2ea cmd/unlinkapps: fix Rubocop warnings. 2016-09-11 17:59:00 +01:00
Max Nordlund
fa1fd70a37 Add all the top level comments 2016-04-10 22:59:25 +02:00
Martin Afanasjew
ea38a70395 prune: handle broken app symlinks
Remove broken symlinks from `/Applications` and `~/Applications` that
were previously created by `brew linkapps`, but are no longer valid
because formulae were uninstalled or the provided apps have changed.
2016-04-06 10:31:54 +02:00
Martin Afanasjew
b50e950f0e unlinkapps: add --dry-run option
Add `--dry-run` option as is customary for destructive commands. Update
`bash` completion and man page accordingly. Also correct and update
documentation for both `brew linkapps` and `brew unlinkapps` in more
general terms.
2016-04-06 10:31:54 +02:00
Martin Afanasjew
dcf406f1e4 unlinkapps: modernize
Simplify code by using `Pathname` methods as much as possible. Also
avoid calling external commands for basic functionality like unlinking,
reduce code duplication by using a method from `cmd/linkapps.rb`, count
unlinked symlinks with `ObserverPathnameExtension`, and adjust output
for consistency with `brew linkapps`.
2016-04-06 10:31:54 +02:00
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