Skip to content

Commit

Permalink
Improve drush shell command so it does the right thing when no site-i…
Browse files Browse the repository at this point in the history
…nstalled drush
  • Loading branch information
rfay committed Dec 31, 2020
1 parent 09943b4 commit 975e141
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 33 deletions.
5 changes: 1 addition & 4 deletions cmd/ddev/cmd/dotddev_assets/commands/web/README.txt
@@ -1,7 +1,4 @@
#ddev-generated
Scripts in this directory will be executed inside the web
container. You can copy the example file or just rename it:
`mv drush.example drush`, for example, and it will become
a live command.
Scripts in this directory will be executed inside the web container.

See https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/#environment-variables-provided for a list of environment variables that can be used in the scripts.
13 changes: 0 additions & 13 deletions cmd/ddev/cmd/dotddev_assets/commands/web/drush.example

This file was deleted.

8 changes: 0 additions & 8 deletions cmd/ddev/cmd/dotddev_assets/commands/web/reload-nginx.example

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/ddev/cmd/global_dotddev_assets/commands/web/README.txt
@@ -1,7 +1,7 @@
#ddev-generated
Scripts in this directory will be executed inside the web
container. You can copy the example file or just rename it:
`mv drush.example drush`, for example, and it will become
`mv reload-nginx.example reload-nginx`, for example, and "ddev reload-nginx" will become
a live command.

See https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/#environment-variables-provided for a list of environment variables that can be used in the scripts.
4 changes: 4 additions & 0 deletions cmd/ddev/cmd/global_dotddev_assets/commands/web/drush
Expand Up @@ -6,4 +6,8 @@
## Example: "ddev drush uli" or "ddev drush sql-cli" or "ddev drush --version"
## ProjectTypes: drupal7,drupal8,drupal9,backdrop

if ! command -v drush >/dev/null; then
echo "drush is not available. You may need to 'ddev composer require drush/drush'"
exit 1
fi
drush "$@"

0 comments on commit 975e141

Please sign in to comment.