Installing Drupal with Drush make and install profile and using a bash script - how to answer yes/no?

StackOverflow https://stackoverflow.com/questions/16193892

  •  11-04-2022
  •  | 
  •  

Question

I have a bash script and when I run it, I'm asked the question:

"You are about to create a sites/default/files directory and create a sites/default/settings.php file and DROP all tables in your 'geo_test' database. Do you want to continue? (y/n)"

How do I answer 'y' automatically?

#!/bin/bash
cd /Applications/MAMP/htdocs
#sudo rm -rf geoslate
drush make distro.make geoslate --working-copy --no-gitinfofile
cd geoslate
drush si geoslate --db-url='mysql://root:root@localhost/geo_test' --site-name=Geoslate
Was it helpful?

Solution

Adding the -y option should to it:

drush si geoslate -y --db-url='mysql://root:root@localhost/geo_test' --site-name=Geoslate
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top