Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

brew linkapps should *move* instead of linking #22379

Closed

Conversation

ELLIOTTCABLE
Copy link
Contributor

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.)

This also adds a `--symlink` flag to preserve the old behaviour for those who preferred it; as well
as a `--force` flag for manually upgrading anything Homebrew might have created.
@ELLIOTTCABLE
Copy link
Contributor Author

One note: f10ede8 does not rename the command. I only wish to open the discussion here; if my changes are generally amenable, I'll need to add a commit that renames the command. I also wish to write/push documentation for brew linkapps in general, as there seems to be none; but I'll do that in a separate commit, once this and #22378 are resolved. (=

@adamv
Copy link
Contributor

adamv commented Sep 8, 2013

No.

@adamv adamv closed this Sep 8, 2013
@chdiza
Copy link
Contributor

chdiza commented Sep 8, 2013

I'd be against this. So what if it's surprising to the new user. What matters is not whether its surprising, but whether it's good or bad. And at least half of what is good about homebrew in general is the ability to unlink (and therefore quasi-disable) without removing. That would be destroyed for GUI apps if this PR is accepted.

That said, the symlinkphobia of various parts of OSX can be a pain. So this sounds like one of those cases where it's best to just make your own external command (say, brew-moveapps.rb) and just call it instead of linkapps.

FYI: By far the best way to associate apps with filetypes is the venerable RCDefaultApp, which still works flawlessly on 10.8. I mention this because it's not afraid of symlinks. For years I've had it pick up my symlink to MacVim.

@ELLIOTTCABLE
Copy link
Contributor Author

@adamv, @chdiza Okay, then, how about as an optional flag? The behavior is easily reversible.

@adamv
Copy link
Contributor

adamv commented Sep 8, 2013

No moving, sorry.

@chdiza
Copy link
Contributor

chdiza commented Sep 8, 2013

Just take your revised version of brew-linkapps.rb, make a copy, rename the copy to brew-moveapps.rb, and put it somewhere in your $PATH. From that point on, just do brew moveapps whenever you have been doing brew linkapps.

I have a dedicated dot folder in $HOME for this, that I added to my $PATH. That way, you can have all kinds of custom functionality without dealing with the nightmare of merging (which would happen if I left my custom commands in the brew tree).

The devs can't adopt every good idea, or every harmless optional flag for something, for brew would get unwieldy. But they've given us the facility to adopt our own good (or bad) ideas, without needing to know git.

@MikeMcQuaid
Copy link
Member

What @chdiza said.

ELLIOTTCABLE added a commit to ELLIOTTCABLE/homebrew that referenced this pull request Sep 8, 2013
@ELLIOTTCABLE
Copy link
Contributor Author

Okay. Updated #22380 to reflect this decision.

ELLIOTTCABLE added a commit to ELLIOTTCABLE/homebrew that referenced this pull request Sep 17, 2013
@Homebrew Homebrew locked and limited conversation to collaborators Feb 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants