buo / homebrew-cask-upgrade

A command line tool for upgrading every outdated app installed by Homebrew Cask
MIT License
2.44k stars 90 forks source link

Symlink command to be brew-cask external command #42

Closed MPLew-is closed 7 years ago

MPLew-is commented 7 years ago

While I was poking around the homebrew core, I discovered that brew-cask supports external commands in the form brewcask-{command}, as shown in the command-line interface source. This change takes advantage of that, and makes it easy to call this command using brew cask upgrade, as opposed to the current brew cu. And, built-in commands take precedence, meaning that, if brew-cask ever adds an upgrade command, this will fall back to the expected behavior, but preserve calling with brew cu.

MPLew-is commented 7 years ago

Well, I guess I didn't test this thoroughly enough, as brew-cask doesn't like when brew-cask-upgrade waits for user input, and fails saying the command wasn't found. I have a potential solution, but I can't test it until I have another cask that needs upgrading, so I'll close this and re-open another PR when I can test it more.

I also have no clue if a change like this is even something you want. Personally, I vastly prefer being able to use brew cask upgrade, as it fits in better with the existing hombrew style, but I can also just maintain this for my own use, too.

buo commented 7 years ago

Only brew cask upgrade --yes works well with this PR as you mentioned. If you have a solution to the problem, you can easily test it by just changing a directory name. For example,

cd /usr/local/Caskroom/atom
mv 1.15.0 1.14.0

Feel free to open a new PR if it works well. Thank you.

MPLew-is commented 7 years ago

Awesome, that will help immensely in testing what I have in mind! I'll open a new PR once I can test out my changes.