From: Antonio Ospite Date: Mon, 27 Aug 2018 14:01:43 +0000 (+0200) Subject: create-profile.sh: fix also the submit callback when creating a new profile X-Git-Tag: v0.1.2~1 X-Git-Url: https://git.ao2.it/drupal-init-tools.git/commitdiff_plain/753d330f19438d3d675421e1ffb292cfbaa5dc52?ds=inline;hp=3fb41b675be9536cf1c3f18ca847edf1c96ca242 create-profile.sh: fix also the submit callback when creating a new profile When creating a new profile from an existing one, fix also the usage of the submit callbacks, not only the functions names. --- diff --git a/libexec/create-profile.sh b/libexec/create-profile.sh index 370963d..57e3731 100755 --- a/libexec/create-profile.sh +++ b/libexec/create-profile.sh @@ -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 - 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