superatomic / homebrew-bundle-extensions

🗄 Command extensions for Homebrew that allow for easy modification of brew bundles.
https://gh.superatomic.dev/homebrew-bundle-extensions
BSD 2-Clause "Simplified" License
14 stars 2 forks source link

Add `brew drop` command #3

Closed superatomic closed 2 years ago

superatomic commented 2 years ago

The brew drop [FORMULA|CASK...] command should remove a formula and/or cask from a Brewfile.

It will function as the opposite of the brew install and brew add relationship, being the equivalent of brew uninstall, but simply removing formulae, casks, and taps from a Brewfile instead of uninstalling them.

Previous content and additional discussion is in #1. This includes @boldandbrad's amazing idea to name the command brew drop.

Additionally, for when #4 is implemented, this command should also be able to remove mas app lines.

Important questions:

boldandbrad commented 2 years ago
  • [ ] Should comments on the same line as the formula/cask be removed as well?

I think yes by default. I don't think I'd want to manually cleanup comments - kinda defeats the purpose. Also, I know many people commit their Brewfile to git, so history would be preserved if they needed to revert or check changes before commit.

For those who want to keep comments we can add an optional flag to the drop command.

superatomic commented 2 years ago

I should be able to start working on implementing this on June 9th.

superatomic commented 2 years ago

It's definitely possible to do, but I've been running into a bit of trouble with parsing mas arguments as described in #4 so that they can also be removed. I'm also not going to be able to write more code for a few days soon, so this feature and #4 might take a bit longer than expected for me to implement.