create-profile.sh: fix pm-list invocation to be compatible with Drush 9
[drupal-init-tools.git] / libexec / create-profile.sh
index fae4bcc..aa627b0 100755 (executable)
@@ -81,8 +81,8 @@ pushd "$WEB_ROOT"
 # However getting them before exporting the configuration and generating the
 # profile is cleaner.
 #
-ENABLED_MODULES="$($DRUSH pm-list --type=module --status=enabled --pipe | tr '\n' ',')"
-ENABLED_THEMES="$($DRUSH pm-list --type=theme --status=enabled --pipe | tr '\n' ',')"
+ENABLED_MODULES="$($DRUSH pm-list --type=module --field=name --status=enabled --pipe | tr '\n' ',' | sed 's/,$//')"
+ENABLED_THEMES="$($DRUSH pm-list --type=theme --field=name --status=enabled --pipe | tr '\n' ',' | sed 's/,$//')"
 
 $DRUPAL_CONSOLE generate:profile \
   --profile="$PROFILE_TITLE" \