File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ Function Add-ComposertoolHelper() {
205
205
if (Test-Path $composer_lock ) {
206
206
Remove-Item - Path $composer_lock - Force
207
207
}
208
- if (composer global show $prefix$tool - a 2>&1 | findstr ' ^type *: *composer-plugin' ) {
208
+ if (composer global show $prefix$tool - a 2>&1 | findstr ' ^type *: *composer-plugin' -and ( $composer_args -ne ' ' ) ) {
209
209
composer global config -- no- plugins allow- plugins." $prefix$tool " true > $null 2>&1
210
210
}
211
211
composer global require $prefix$release $composer_args > $null 2>&1
@@ -215,7 +215,7 @@ Function Add-ComposertoolHelper() {
215
215
$scoped_dir_suffix = (Get-FileHash - InputStream $release_stream - Algorithm sha256).Hash
216
216
$scoped_dir = " $composer_bin \_tools\$tool -$scoped_dir_suffix "
217
217
$unix_scoped_dir = $scoped_dir.replace (' \' , ' /' )
218
- if (composer show $prefix$tool - d $unix_scoped_dir - a 2>&1 | findstr ' ^type *: *composer-plugin' ) {
218
+ if (composer show $prefix$tool - d $unix_scoped_dir - a 2>&1 | findstr ' ^type *: *composer-plugin' -and ( $composer_args -ne ' ' ) ) {
219
219
composer config - d $unix_scoped_dir -- no- plugins allow- plugins." $prefix$release " true > $null 2>&1
220
220
}
221
221
if (-not (Test-Path $scoped_dir )) {
@@ -252,6 +252,7 @@ Function Add-Composertool() {
252
252
[string ]
253
253
$scope
254
254
)
255
+ $composer_args = " "
255
256
if ($composer_version.split (' .' )[0 ] -ne " 1" ) {
256
257
$composer_args = " --ignore-platform-req=ext-*"
257
258
if ($tool -match " prestissimo|composer-prefetcher" ) {
Original file line number Diff line number Diff line change @@ -162,17 +162,17 @@ add_composertool_helper() {
162
162
enable_extensions curl mbstring openssl
163
163
if [ " $scope " = " global" ]; then
164
164
sudo rm -f " $composer_lock " > /dev/null 2>&1 || true
165
- if composer global show " $prefix$tool " -a 2>&1 | grep -qE ' ^type *: *composer-plugin' ; then
165
+ if composer global show " $prefix$tool " -a 2>&1 | grep -qE ' ^type *: *composer-plugin' && [ -n " $composer_args " ] ; then
166
166
composer global config --no-plugins allow-plugins." $prefix$tool " true > /dev/null 2>&1
167
167
fi
168
168
composer global require " $prefix$release " " $composer_args " > /dev/null 2>&1
169
- composer global show " $prefix$tool " 2>&1 | grep -E ^versions | sudo tee /tmp/composer_show .log > /dev/null 2>&1
169
+ composer global show " $prefix$tool " 2>&1 | grep -E ^versions | sudo tee /tmp/composer .log > /dev/null 2>&1
170
170
else
171
171
scoped_dir=" $composer_bin /_tools/$tool -$( echo -n " $release " | shasum -a 256 | cut -d ' ' -f 1) "
172
172
if ! [ -d " $scoped_dir " ]; then
173
173
mkdir -p " $scoped_dir "
174
174
echo ' {}' | tee " $scoped_dir /composer.json" > /dev/null
175
- if composer show " $prefix$tool " -d " $scoped_dir " -a 2>&1 | grep -qE ' ^type *: *composer-plugin' ; then
175
+ if composer show " $prefix$tool " -d " $scoped_dir " -a 2>&1 | grep -qE ' ^type *: *composer-plugin' && [ -n " $composer_args " ] ; then
176
176
composer config -d " $scoped_dir " --no-plugins allow-plugins." $prefix$tool " true > /dev/null 2>&1
177
177
fi
178
178
composer require " $prefix$release " -d " $scoped_dir " " $composer_args " > /dev/null 2>&1
@@ -188,6 +188,7 @@ add_composertool() {
188
188
release=$2
189
189
prefix=$3
190
190
scope=$4
191
+ composer_args=
191
192
composer_major_version=$( cut -d' .' -f 1 /tmp/composer_version)
192
193
if [ " $composer_major_version " != " 1" ]; then
193
194
composer_args=" --ignore-platform-req=ext-*"
You can’t perform that action at this time.
0 commit comments