#!/bin/bash

#ddev-generated
## Description: Add Drupal core and other needed dependencies.
## Usage: composer-ci [flags] [args]
## Example: "ddev composer-ci"
## ProjectTypes: drupal8,drupal9,drupal10
## ExecRaw: true

export _WEB_ROOT=$DDEV_DOCROOT
[[ $DDEV_PROJECT_TYPE == "drupal10" ]] && export _TARGET_CORE=^10
[[ $DDEV_PROJECT_TYPE == "drupal9" ]] && export _TARGET_CORE=^9
[[ $DDEV_PROJECT_TYPE == "drupal8" ]] && export _TARGET_CORE=^8
cd "$DDEV_COMPOSER_ROOT"
curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/1.0.x/scripts/expand_composer_json.php
php expand_composer_json.php $DDEV_SITENAME
rm -f expand_composer_json.php
