-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Unattended install #46779
Comments
Using that script, you can't practically. That script is very much intended to require user interaction and permission, given the changes it makes. What's your use case that requires silent installation? |
Thanks for the quick reply @DomT4. I'm building an installer pkg using theluggage for a custom tool I'm building. The tool has a lot of dependancies, so it would be really great to leverage homebrew within my installer. EDIT: I should also mention that my installer pkg installs command line tools for 10.8 and up. So the homebrew dependancies are covered. |
No worries! You could probably do something like: #!/bin/bash
git clone https://github.com/Homebrew/homebrew.git /desired/path
export PATH="/path/to/brew/bin":$PATH
export HOMEBREW_CACHE="/path/you/know/you/can/write/into"
export HOMEBREW_LOGS="/path/you/know/you/can/write/into"
brew update
brew install xyz If you stuck with If you're planning to run this or tell users to run this on machines you don't own it's probably a good idea to give users a heads-up on that first, and if they need to retain |
Oh great, I didn't even consider this for a one-time use! But, say I want to permanently install homebrew (as a bonus).
This doesn't include the checks for preexisting files/dirs, but you get the gist. Where does homebrew put the logs? Am I missing anything else? |
You can use it non-interactively, it just checks if it's being run in a terminal with interactivity. https://github.com/Homebrew/install/blob/fabfe35de50e23464a52deedcc1954e95e302ee7/install#L183
https://github.com/mikemcquaid/strap is an option for a full system install.
Please don't autoinstall Homebrew in your installer; if people have Homebrew already installed (particularly in a different location it'll be extremely confusing) when you install a bunch of new packages for them. The right thing to do is to build everything you need yourself and bundle the output binaries into your |
I can't figure out how to install homebrew without user interaction. No matter what I do I'm either prompted to hit
RETURN key
or enter sudo password. I've tried the following:The text was updated successfully, but these errors were encountered: