From 47b0702fefe2c2077a42c1fd8e166e826165ffe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20L=C3=B3pez?= Date: Wed, 11 Dec 2024 09:40:49 +0100 Subject: [PATCH] feature: Kickstart command allow to select drupal version to install --- commands/host/aljibe-kickstart | 25 +++++++++++++++++++++---- kickstart/common/.gitignore | 2 +- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/commands/host/aljibe-kickstart b/commands/host/aljibe-kickstart index 9d8e668..b96f544 100644 --- a/commands/host/aljibe-kickstart +++ b/commands/host/aljibe-kickstart @@ -5,15 +5,31 @@ ## Flags: [{"Name":"noinstall","Usage":"setup --noinstall"}] ## Example: ddev aljibe-kickstart - +DRUPAL_VERSION=d11 +PROJECT_TYPE=drupal11 AUTO_CONFIRM=false +# Check if ${DDEV_APPROOT}/.ddev/kickstart/ exists, if not show a warning and exit +if [ ! -d "${DDEV_APPROOT}/.ddev/kickstart" ]; then + echo "No kickstart files found in ${DDEV_APPROOT}/.ddev/kickstart/" + echo "If you want to kickstart your project again, reinstall aljibe add-on:" + echo " - ddev add-on get metadrop/ddev-aljibe" + echo "And then launch aljibe-kickstart command again." + exit 1 +fi + + while (( "$#" )); do case "$1" in -y|--yes) AUTO_CONFIRM=true shift ;; + d10) + DRUPAL_VERSION=d10 + PROJECT_TYPE=drupal10 + shift + ;; *) shift ;; @@ -28,9 +44,10 @@ else fi if [ "$CONFIRMATION" != "n" ]; then - cp -rTf ${DDEV_APPROOT}/.ddev/aljibe-kickstart ${DDEV_APPROOT} - rm -fR ${DDEV_APPROOT}/.ddev/aljibe-kickstart - ddev config --project-type=drupal --docroot=web + cp -rTf ${DDEV_APPROOT}/.ddev/kickstart/common ${DDEV_APPROOT} + cp -rTf ${DDEV_APPROOT}/.ddev/kickstart/common/${DRUPAL_VERSION} ${DDEV_APPROOT} + rm -fR ${DDEV_APPROOT}/.ddev/kickstart + ddev config --project-type=${PROJECT_TYPE} --docroot=web echo "Kickstart files have been copied." else echo "Operation cancelled." diff --git a/kickstart/common/.gitignore b/kickstart/common/.gitignore index 3ae2473..4052e57 100644 --- a/kickstart/common/.gitignore +++ b/kickstart/common/.gitignore @@ -66,7 +66,7 @@ nbproject/ settings.ddev*.php ## Aljibe -aljibe-kickstart +.ddev/kickstart ## mkdocs docs/site