Skip to content

Commit

Permalink
fix: use DP_CORE_VERSION when there's no issue_fork
Browse files Browse the repository at this point in the history
  • Loading branch information
shaal committed Apr 19, 2024
1 parent cb89d11 commit f61627b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .gitpod/drupal/drupalpod-setup/drupal_version_specifics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ fi
# Adding support for composer-drupal-lenient - https://packagist.org/packages/mglaman/composer-drupal-lenient
if [[ "$DP_CORE_VERSION" =~ ^11(\..*)?$ ]]; then
# admin_toolbar and devel are not compatible yet with Drupal 11
DP_EXTRA_ADMIN_TOOLBAR=
DP_EXTRA_DEVEL=
export DP_EXTRA_ADMIN_TOOLBAR=
export DP_EXTRA_DEVEL=
if [ "$DP_PROJECT_TYPE" != "project_core" ]; then
export COMPOSER_DRUPAL_LENIENT=mglaman/composer-drupal-lenient
else
Expand Down
8 changes: 5 additions & 3 deletions .gitpod/utils/ddev-in-gitpod-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ fi

# If this is an issue fork of Drupal core - set the drupal core version based on that issue fork
if [ "$DP_PROJECT_TYPE" == "project_core" ] && [ -n "$DP_ISSUE_FORK" ]; then
export VERSION_FROM_GIT=$(grep 'const VERSION' repos/drupal/core/lib/Drupal.php | awk -F "'" '{print $2}')
DRUPAL_CORE_VERSION=$(grep 'const VERSION' repos/drupal/core/lib/Drupal.php | awk -F "'" '{print $2}')
else
DRUPAL_CORE_VERSION=$DP_CORE_VERSION
fi

# set PHP version, based on https://www.drupal.org/docs/getting-started/system-requirements/php-requirements#versions
major_version=$(echo $VERSION_FROM_GIT | cut -d '.' -f 1)
minor_version=$(echo $VERSION_FROM_GIT | cut -d '.' -f 2)
major_version=$(echo $DRUPAL_CORE_VERSION | cut -d '.' -f 1)
minor_version=$(echo $DRUPAL_CORE_VERSION | cut -d '.' -f 2)

# Before Drupal 10.2, we should use php 8.2, otherwise use php 8.3
if (( major_version < 10 )) || { (( major_version == 10 )) && (( minor_version < 2 )); }; then
Expand Down

0 comments on commit f61627b

Please sign in to comment.