mxcl/homebrew — pull request #22379 by ELLIOTTCABLE (2013-09-07 18:34:23+00:00)
Title: `brew linkapps` should *move* instead of linking

Although the `brew linkapps` operation is studiously in-line with the rest of the Homebrew commands, its current operation is *very* surprising to the newcomer, and doesn't integrate very well with the OS X GUI as a whole. If someone's *using* Homebrew, and thus an OS X machine, I believe they can be assumed to be using the rest of the system's features on a daily basis, including the GUI. (Else, why not use another *NIX?)

Most importantly, one has to navigate deep into the Homebrew file-tree from within the GUI to set the default application to open a particular file with, or to select an application to link to a particular file-type. This is because as it currently stands, installing an *application* with Homebrew (which, admittedly, is a fairly rare occurrence … with some important exceptions) suggests afterwards that one use `brew linkapps`, which *itself* proceeds to *symlink* the applications into OS X-supplied directories. Unfortunately, none of OS X's features (Spotlight, open-with, default-apps, etceteras) seem to support symlinks, currently.

I propose, for ease-of-use and lease-surprising-effect purposes, that `brew linkapps` be refactored to *move* the `.app` folders into the relevant `Applications/` folder, and then symlink them **back** into their build-tree.

I attach a patch that does exactly this. I included flags to modify the functionality, as well as restore the old functionality. Tested flawlessly with MacVim.

(Relevant: #22378.)