Skip to content

Commit 59c8d8e

Browse files
author
Benjamin Calef
committed
[composer] fix composer config script for lower versions and limit plugins allowed
1 parent 8ca7f0d commit 59c8d8e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

provision/110-magento-app.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,15 @@ else
3434
rm -f "$PROJECT_BUILD"/app/etc/config.php "$PROJECT_BUILD"/app/etc/env.php
3535
fi
3636

37-
echo '--- composer allow-plugins ---'
38-
sudo -u vagrant composer config -d "$PROJECT_BUILD" --no-interaction --no-plugins allow-plugins.*/* true
39-
4037
# Composer install
38+
echo '--- composer allow-plugins ---'
39+
COMPOSER_VERSION=$(composer -V | cut -d " " -f 3);
40+
if $(dpkg --compare-versions "${COMPOSER_VERSION}" "ge" "2.0"); then
41+
sudo -u vagrant composer config -d "$PROJECT_BUILD" --no-interaction --no-plugins "allow-plugins.magento/*" true
42+
sudo -u vagrant composer config -d "$PROJECT_BUILD" --no-interaction --no-plugins "allow-plugins.laminas/laminas-dependency-plugin" true
43+
sudo -u vagrant composer config -d "$PROJECT_BUILD" --no-interaction --no-plugins "allow-plugins.dealerdirect/phpcodesniffer-composer-installer" true
44+
sudo -u vagrant composer config -d "$PROJECT_BUILD" --no-interaction --no-plugins "allow-plugins.magento-composer-installer" true
45+
fi
4146
sudo -u vagrant COMPOSER_MEMORY_LIMIT=-1 composer install -d "$PROJECT_BUILD" --no-progress --no-interaction
4247

4348
# Rsync directory

0 commit comments

Comments
 (0)