Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: brew install commands in install.sh #338

Open
bradical opened this issue Mar 31, 2021 · 5 comments
Open

Question: brew install commands in install.sh #338

bradical opened this issue Mar 31, 2021 · 5 comments

Comments

@bradical
Copy link

bradical commented Mar 31, 2021

Would you expect this to work? I'm a little unclear on the order of things and whether brew would be available at the time. My example is something like:

postgresql/install.sh

brew install postgresql; brew services start postgresql

Wasn't sure if there was a better technique for installing a bunch of brew things as part of install

Still digging these years later. Thanks!

@holman
Copy link
Owner

holman commented Mar 31, 2021

I think so? I think the bootstrap gets run first, and then install scripts get run separately afterwards, so brew should be around at that point.

@bradical
Copy link
Author

bradical commented Mar 31, 2021

is that how you would recommend doing it or is there some other way to handle installing brew packages on setup? seemed like you might have done something else in the past and the moved away from it?

@holman
Copy link
Owner

holman commented Mar 31, 2021

I think I had some casks set up for installing macOS apps, but moved away from that. But yeah, I'd do this otherwise (and tbh, probably should, haha. It's been awhile since I seriously took a real look at my dotfiles!)

@jacobwgillespie
Copy link
Contributor

I know this repo used to have a Brewfile for installing brew software - I'm using one in my dotfiles: https://github.com/jacobwgillespie/dotfiles/blob/main/Brewfile. You can install regular formulae, casks, fonts, even App Store apps.

brew bundle will install everything listed in the Brewfile, which is nice. I have a call to brew bundle in my setup script. In this repo, bin/dot does install Homebrew before executing the install.sh files, so you could add brew bundle to any install.sh or directly to dot.

Another cool thing that brew bundle can do is brew bundle cleanup. That will print all the things you have installed manually that are not in your Brewfile. And then brew bundle cleanup -f will actually uninstall those extra packages. In this way you can use a Brewfile as the source-of-truth for what's installed with Brew on your machine, and pretty easily find anything not covered and either add it or let Brew clean it up.

@holman
Copy link
Owner

holman commented Apr 1, 2021

Yeah, that's rad- I had a Brewfile before, but pulled it out for some reason that I can't quite remember. I think part of it might have been it didn't integrate as closely with the App Store (although it looks like that's more reasonable to do now). I also didn't know about bundle cleanup; that's really cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants