Homebrew / legacy-homebrew

💀 The former home of Homebrew/homebrew (deprecated)
https://brew.sh
26.99k stars 11.36k forks source link

`brew --prefix cask` reposts non-existing dir #33313

Closed emilbayes closed 9 years ago

emilbayes commented 9 years ago

Running brew --prefix cask reports the dir that cask was installed in, but no longer is. I have run brew update and brew cleanup. I have removed cask by brew uninstall cask. brew doctor reports nothing. I'm on a brand new MacBook Pro and have just updated to OS X Yosemite, however I had the same issue on Mavericks.

Brew version: 0.9.5

DomT4 commented 9 years ago

You'll probably also need to manually remove the cask directories involved for it to go away completely. Try brew untap caskroom/homebrew-cask and try again. You may also need to manually remove the caskroom directory in opt.

emilbayes commented 9 years ago

@DomT4 cask is not the same as brew-cask. That's the mistake I made :) I meant to install caskroom, but inadvertently installed a project management tool called cask

DomT4 commented 9 years ago

@tixz Aha! Indeed. Well, now I feel a little silly :wink:. Did you try a brew cleanup && brew prune after you removed cask? Sometimes helps to remove any lingering directories.

emilbayes commented 9 years ago

Have tried both, neither solved the issue. It's not that it's a major problem for me, I just thought that this might be a bug worth getting rid of. Lot's of peoples' dotfiles rely on checking brew --prefix something, and if this is a bug, would yield lots of false positives.

The path reported by homebrew doesn't exist either, so it must be something internal to homebrew.

DomT4 commented 9 years ago
➜  ~  brew --prefix cask
/usr/local/opt/cask
➜  ~  brew remove cask
Uninstalling /usr/local/Cellar/cask/0.7.2...
➜  ~  brew --prefix cask
/usr/local/Cellar/cask/0.7.2
➜  ~  brew remove cask
Error: No such keg: /usr/local/Cellar/cask
➜  ~  brew cleanup && brew prune
Pruned 0 dead formulae
Tapped 675 formulae
➜  ~  brew --prefix cask
/usr/local/Cellar/cask/0.7.2

Yeah, that's a little odd. Maybe that's intentional behaviour. I'm not sure. I'll wait for one of the maintainers to chime in on this, they know the internals better than I ever could.

tdsmith commented 9 years ago

brew --prefix doesn't check if a formula is installed or not. From man brew: "Display the location in the cellar where formula is or would be installed."