I've looked around and haven't found an answer to this. This is not to be mistaken with questions about bash scripts.
I'm looking to automate an installation for a composer package. There are several requested inputs during the installation process - though they have acceptable defaults. I would like to output a through multiple times to accept the defaults with a bash function.
sage() {
if (( $# == 0 ))
then
composer create-project roots/sage $1
else
composer create-project roots/sage
fi
echo "\r";
echo "\r";
echo "\r";
echo "\r";
echo "\r";
echo "\r";
echo "https://localhost/$1";
}
This doesn't do what I want, and still focuses inside the first input box. How do I need to change this so the carriage return is inserted after the package has installed?
Trying Expect:
- Does it have to be verbatim what the input question is or is it just a regex?
Edit:
So far, I've tried
expect "Theme Name [Sage Starter Theme]" { send "\r" }
------------------------------------------------
expect "Theme Name [Sage Starter Theme]"
send "\r"