From f903bbd565927fa1e0c8355c454d96d6fee65991 Mon Sep 17 00:00:00 2001 From: Lucas Araujo Rodrigues Date: Tue, 14 Jun 2016 09:32:22 -0300 Subject: [PATCH] Updated drnew (Function to create a new Drupal installation) --- plugins/drush/drush.plugin.zsh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/plugins/drush/drush.plugin.zsh b/plugins/drush/drush.plugin.zsh index 40ddb6ab..8a20d79f 100644 --- a/plugins/drush/drush.plugin.zsh +++ b/plugins/drush/drush.plugin.zsh @@ -46,18 +46,26 @@ function drnew() { drush dl drupal --drupal-project-rename=$WEBSITE_NAME - echo "Moving to /var/www" - mv $WEBSITE_NAME /var/www - cd /var/www/$WEBSITE_NAME + echo "Type your localhost directory: (Leave empty for /var/www/html/)" + read DIRECTORY + + if [[ $DIRECTORY == "" ]] then + DIRECTORY="/var/www/html/" + fi + + echo "Moving to $DIRECTORY$WEBSITE_NAME" + sudo mv $WEBSITE_NAME $DIRECTORY + cd $DIRECTORY$WEBSITE_NAME echo "Database's user: " read DATABASE_USR echo "Database's password: " read -s DATABASE_PWD - echo "Database's name: " + echo "Database's name for your project: " read DATABASE - drush site-install standard --db-url="mysql://$DATABASE_USR:$DATABASE_PWD@localhost/$DATABASE" --site-name=$WEBSITE_NAME + DB_URL="mysql://$DATABASE_USR:$DATABASE_PWD@localhost/$DATABASE" + drush site-install standard --db-url=$DB_URL --site-name=$WEBSITE_NAME open_command $HOST$WEBSITE_NAME echo "Done"