Automatic (no prompt) Homebrew installation using pending

Following the installation instructions for Homebrew, you can use the following command to install:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

This works, but requires user input twice; to confirm the installation and at the sudo prompt called by the script:

$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir /usr/local
Password:

Homebrew has no argument for an unattended installation, so the only option I can think of is to programmatically enter the expected data. I tried using expect, but I can not get the syntax correctly:

$ expect -c 'spawn ruby -e \"\$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)\";expect "RETURN";send "\n"'
ruby: invalid option -f  (-h will show valid options) (RuntimeError)
send: spawn id exp7 not open
    while executing
"send "\n""

What am I doing wrong?

+4
source share

Source: https://habr.com/ru/post/1546110/


All Articles