From 1c14f237b6dce43f7439a939d356595daf081eb8 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 15 Nov 2012 13:31:13 -0200 Subject: Using $command instead of $1 --- templates/drupal.sh.erb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/templates/drupal.sh.erb b/templates/drupal.sh.erb index 04bce65..5695320 100644 --- a/templates/drupal.sh.erb +++ b/templates/drupal.sh.erb @@ -50,12 +50,14 @@ function drupal_check_not_existing { # Iterate through all drupal instances function drupal_iterate { - if [ -z "$1" ]; then + local command="$1" + + if [ -z "$command" ]; then return fi - if [ "$1" != "cron" ] && [ "$SILENT" != "yes" ]; then - echo "Issuing $1 in all installed instances..." + if [ "$command" != "cron" ] && [ "$SILENT" != "yes" ]; then + echo "Issuing $command in all installed instances..." fi for version in $SERIES; do @@ -77,15 +79,15 @@ function drupal_iterate { if [ -e "$drupal/settings.php" ]; then hash="`sha1sum $drupal/settings.php | cut -d ' ' -f 1`" # Process sites just once, avoiding symlinks - if echo $settings_hash | grep -q -v "$1:$hash"; then - settings_hash="$settings_hash-$1:$hash" - if [ "$1" != "cron" ] && [ "$SILENT" != "yes" ]; then + if echo $settings_hash | grep -q -v "$command:$hash"; then + settings_hash="$settings_hash-$command:$hash" + if [ "$command" != "cron" ] && [ "$SILENT" != "yes" ]; then echo "Processing $drupal..." fi - if [ "$1" == "update" ] || [ "$1" == "cron-update" ]; then + if [ "$command" == "update" ] || [ "$command" == "cron-update" ]; then shift - drupal_update $1 $drupal $* + drupal_update $command $drupal $* else drush -l $drupal $* fi -- cgit v1.2.3