summaryrefslogtreecommitdiff
path: root/plugins/drush/drush.plugin.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/drush/drush.plugin.zsh')
-rw-r--r--plugins/drush/drush.plugin.zsh87
1 files changed, 42 insertions, 45 deletions
diff --git a/plugins/drush/drush.plugin.zsh b/plugins/drush/drush.plugin.zsh
index 8a20d79f2..fbf9656e6 100644
--- a/plugins/drush/drush.plugin.zsh
+++ b/plugins/drush/drush.plugin.zsh
@@ -1,19 +1,18 @@
-# Drush support.
-
+# Functions
function dren() {
- drush en $@ -y
+ drush en "$@" -y
}
function dris() {
- drush pm-disable $@ -y
+ drush pm-disable "$@" -y
}
function drpu() {
- drush pm-uninstall $@ -y
+ drush pm-uninstall "$@" -y
}
function drf() {
- if [[ $1 == "" ]] then
+ if [[ -z "$1" ]] then
drush core-config
else
drush core-config --choice=$1
@@ -21,58 +20,56 @@ function drf() {
}
function drfi() {
- if [[ $1 == "fields" ]]; then
- drush field-info fields
- elif [[ $1 == "types" ]]; then
- drush field-info types
- else
- drush field-info
- fi
+ case "$1" in
+ fields) drush field-info fields ;;
+ types) drush field-info types ;;
+ *) drush field-info ;;
+ esac
}
function drnew() {
+ (
+ cd
+ echo "Website's name: "
+ read WEBSITE_NAME
- cd ~
- echo "Website's name: "
- read WEBSITE_NAME
+ HOST=http://$(hostname -i)/
- HOST=http://$(hostname -i)/
+ if [[ $WEBSITE_NAME == "" ]] then
+ MINUTES=$(date +%M:%S)
+ WEBSITE_NAME="Drupal-$MINUTES"
+ echo "Your website will be named: $WEBSITE_NAME"
+ fi
- if [[ $WEBSITE_NAME == "" ]] then
- MINUTES=$(date +%M:%S)
- WEBSITE_NAME="Drupal-$MINUTES"
- echo "Your website will be named: $WEBSITE_NAME"
- fi
+ drush dl drupal --drupal-project-rename=$WEBSITE_NAME
- drush dl drupal --drupal-project-rename=$WEBSITE_NAME
+ echo "Type your localhost directory: (Leave empty for /var/www/html/)"
+ read DIRECTORY
- echo "Type your localhost directory: (Leave empty for /var/www/html/)"
- read DIRECTORY
+ if [[ $DIRECTORY == "" ]] then
+ DIRECTORY="/var/www/html/"
+ fi
- if [[ $DIRECTORY == "" ]] then
- DIRECTORY="/var/www/html/"
- fi
+ echo "Moving to $DIRECTORY$WEBSITE_NAME"
+ sudo mv $WEBSITE_NAME $DIRECTORY
+ cd $DIRECTORY$WEBSITE_NAME
- 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 for your project: "
+ read DATABASE
- echo "Database's user: "
- read DATABASE_USR
- echo "Database's password: "
- read -s DATABASE_PWD
- echo "Database's name for your project: "
- read DATABASE
-
- 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"
+ 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"
+ )
}
-# Aliases, sorted alphabetically.
+# Aliases
alias dr="drush"
alias drca="drush cc all" # Deprecated for Drush 8
alias drcb="drush cc block" # Deprecated for Drush 8
@@ -86,8 +83,8 @@ alias drcv="drush cc views"
alias drdmp="drush sql-dump --ordered-dump --result-file=dump.sql"
alias drf="drush features"
alias drfr="drush features-revert -y"
-alias drfu="drush features-update -y"
alias drfra="drush features-revert-all"
+alias drfu="drush features-update -y"
alias drif="drush image-flush --all"
alias drpm="drush pm-list --type=module"
alias drst="drush core-status"