From 4e2d759ba426df1a731861b92d29a6b0a303d111 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Fri, 15 Apr 2016 15:57:36 -0400 Subject: [PATCH] Cleanup dsh drush related stuff --- bin/dsh | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/bin/dsh b/bin/dsh index cc45abb..7bde4af 100755 --- a/bin/dsh +++ b/bin/dsh @@ -463,7 +463,7 @@ show_help () echo " (init-url )" echo echo " drush [command] Execute Drush command (usage: dsh drush [command] [option] [option]...)" - echo " cc [cache_type] Clear Drupal caches (\"dsh cc\" is equal to \"dsh cc all\")" + echo " cc [cache_type] Clear Drupal 7 caches (\"dsh cc\" is equal to \"dsh cc all\")" echo " drupal [command] Execute Drupal Console command (Drupal 8)" echo echo " mysql (sqlc) Opens mysql shell to current project database" @@ -984,7 +984,7 @@ run () if is_tty ; then # need to use $* here to finally resolve slash-escaped string if any. - # passing $@ will not work properly if $@ contains slash espaped string from _drush command + # passing $@ will not work properly if $@ contains slash espaped string from drush command docker exec -it $container_id bash -ic "$*" else docker exec $container_id bash -c "$*" @@ -1059,7 +1059,7 @@ mysql_import () check_docker_running - _drush sql-drop -y + _run drush sql-drop -y local sql_connect sql_connect=$(get_mysql_connect) echo "Importing $filename into the database..." @@ -1103,25 +1103,7 @@ clear_cache () type=$1 fi - if [[ "$(get_current_relative_path)" == "" ]] && [ -d docroot ]; then # we're on top level, let's cd to docroot for drush to work - cd docroot - fi - _run 'drush cc '$type -} - -# Shorthand for executing drush commands -# @param $* arguments and params passed to Drush -_drush () -{ - if is_yml_absent ; then return 2; fi - #if ! get_drush_path; then return; fi - - cwd=$(pwd) - if [[ "$(get_current_relative_path)" == "" ]] && [ -d docroot ]; then # we're on top level, let's cd to docroot for drush to work - cd docroot - fi - _run "drush $@" - cd $cwd + _run "drush cc $type" } # Run Behat tests (also install dependencies through Composer) @@ -1347,7 +1329,7 @@ case $1 in else # slash escape space-delimited parameters for safe passing between functions cmd=$(printf " %q" "$@") - _drush $cmd + _run drush $cmd fi ;; drupal)