create-profile.sh: fix also the submit callback when creating a new profile
authorAntonio Ospite <ao2@ao2.it>
Mon, 27 Aug 2018 14:01:43 +0000 (16:01 +0200)
committerAntonio Ospite <ao2@ao2.it>
Mon, 27 Aug 2018 14:05:40 +0000 (16:05 +0200)
When creating a new profile from an existing one, fix also the usage of
the submit callbacks, not only the functions names.

libexec/create-profile.sh

index 370963d..57e3731 100755 (executable)
@@ -116,7 +116,10 @@ find . -maxdepth 1 -type f ! -name "*.info.yml" -printf "%P\n" |
     cp "${original_file}" "$DESTINATION_FILE"
     if file "$original_file" | grep -q PHP;
     then
     cp "${original_file}" "$DESTINATION_FILE"
     if file "$original_file" | grep -q PHP;
     then
-      sed -i "s/^function ${CURRENT_PROFILE}_/function ${PROFILE_MACHINE_NAME}_/g" "$DESTINATION_FILE"
+      sed -i \
+        -e "s/^function ${CURRENT_PROFILE}_/function ${PROFILE_MACHINE_NAME}_/g" \
+        -e "s/\$form\['#submit'\]\[\] = '${CURRENT_PROFILE}_/\$form\['#submit'\]\[\] = '${PROFILE_MACHINE_NAME}_/g" \
+        "$DESTINATION_FILE"
     fi
   done
 
     fi
   done