-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from franrou/feature/multisite-commands
Issue #18: Feature/multisite commands
- Loading branch information
Showing
3 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
#ddev-generated | ||
## Description: Launches a drush command on all of the sites | ||
## Usage: all-sites-drush [drush command] | ||
|
||
source "$(dirname "$0")/includes/aljibe_includes" | ||
|
||
ENV='local' | ||
COMMAND='' | ||
SITES=() | ||
|
||
COMMAND=$@; | ||
if [ -z "$COMMAND" ]; then | ||
echo "Please provide a drush command" | ||
exit | ||
fi | ||
|
||
## Get all sites from the drush/sites folder. | ||
set_sites_variable | ||
|
||
## Run the command in all sites. | ||
for SITE in "${SITES[@]}"; do | ||
SITE_ALIAS=$SITE.$ENV | ||
echo "Running drush $COMMAND in $SITE" | ||
ddev drush @${SITE_ALIAS} $COMMAND | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,4 +139,4 @@ if [ "$NO_INSTALL" -eq 0 ]; then | |
fi | ||
|
||
# Launch post setup hooks | ||
run_hooks "post_setup" | ||
run_hooks "post_setup" |