Skip to content
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.

Commit

Permalink
Cleanup dsh drush related stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
lmakarov committed Apr 15, 2016
1 parent 8d353b3 commit 4e2d759
Showing 1 changed file with 5 additions and 23 deletions.
28 changes: 5 additions & 23 deletions bin/dsh
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ show_help ()
echo " (init-url <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"
Expand Down Expand Up @@ -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 "$*"
Expand Down Expand Up @@ -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..."
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4e2d759

Please sign in to comment.