Skip to content

Commit

Permalink
feature: Kickstart command allow to select drupal version to install
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjol committed Dec 11, 2024
1 parent 142a23a commit 47b0702
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
25 changes: 21 additions & 4 deletions commands/host/aljibe-kickstart
Original file line number Diff line number Diff line change
Expand Up @@ -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
;;
Expand All @@ -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."
Expand Down
2 changes: 1 addition & 1 deletion kickstart/common/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ nbproject/
settings.ddev*.php

## Aljibe
aljibe-kickstart
.ddev/kickstart

## mkdocs
docs/site
Expand Down

0 comments on commit 47b0702

Please sign in to comment.