Skip to content

Commit

Permalink
Account for no composer.json file on module (#80)
Browse files Browse the repository at this point in the history
* Account for no composer.json file on module

* remove empty composer.json if created by the addon

* cleaner use of bash variables for empty composer removal

* fix: prevent tests from failing
  • Loading branch information
hanoii authored Oct 10, 2024
1 parent 8562303 commit b552de7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions commands/web/expand-composer-json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,12 @@
export _WEB_ROOT=$DDEV_DOCROOT
cd "$DDEV_COMPOSER_ROOT" || exit
curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/scripts/expand_composer_json.php
if [[ ! -f composer.json ]]; then
echo "{}" > composer.json
_ddev_drupal_contrib_empty_composer=true
fi
php expand_composer_json.php "$DDEV_SITENAME"
rm -f expand_composer_json.php
if [ "$_ddev_drupal_contrib_empty_composer" = true ]; then
rm -f composer.json
fi

0 comments on commit b552de7

Please sign in to comment.