]> gitweb.fluxo.info Git - puppet-drupal.git/commitdiff
Using $command instead of $1
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 15 Nov 2012 15:31:13 +0000 (13:31 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 15 Nov 2012 15:31:13 +0000 (13:31 -0200)
templates/drupal.sh.erb

index 04bce658e0e1bda4ee3a7854ee146e12f4790fd1..5695320a3a4c4bdcfe8a0a70908c9cd46415db90 100644 (file)
@@ -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