github.com/drud/ddev@v1.21.5-alpha1.0.20230226034409-94fcc4b94453/pkg/ddevapp/global_dotddev_assets/commands/web/craft (about) 1 #!/bin/bash 2 3 #ddev-generated 4 ## Description: Run Craft CMS command inside the web container 5 ## Usage: craft [flags] [args] 6 ## Example: "ddev craft db/backup" or "ddev craft db/backup ./my-backups" (see https://craftcms.com/docs/4.x/console-commands.html) 7 ## ProjectTypes: craftcms,php 8 ## ExecRaw: true 9 10 if [ "${DDEV_PROJECT_TYPE}" != "craftcms" ]; then 11 echo "The craft command is only available in the craftcms project type. You can update this in your project's config file, followed by restarting the DDEV project." 12 else 13 CRAFT_CMD_ROOT=${CRAFT_CMD_ROOT:="./"} 14 15 cd "${CRAFT_CMD_ROOT}" 16 php craft "$@" 17 fi