Question

I'm writing a custom homebrew formula for installing PHP. It works great except for when I need to install APC (and some others) via PECL. The PECL installation pauses to ask a few questions and causes the brew install to fail or hang due to the lack of user input.

Is there a way to simply accept the defaults in PECL? Or can Homebrew somehow send the Enter key to the system?

Was it helpful?

Solution

Found a user input hack here that worked for me:

system "printf \"no\nno\nno\nno\nyes\nno\n\" | #{prefix}/bin/pecl install -afl apc"
system "printf \"autodetect\n\" | #{prefix}/bin/pecl install -afl libevent-beta"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top