File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -201,11 +201,15 @@ Function Add-ComposertoolHelper() {
201
201
[string ]
202
202
$composer_args
203
203
)
204
+ $tool_version = $release.split (' :' )[1 ]
205
+ if ($NULL -eq $tool_version ) {
206
+ $tool_version = ' *'
207
+ }
204
208
if ($scope -eq ' global' ) {
205
209
if (Test-Path $composer_lock ) {
206
210
Remove-Item - Path $composer_lock - Force
207
211
}
208
- if ((composer global show $prefix$tool - a 2>&1 | findstr ' ^type *: *composer-plugin' ) -and ($composer_args -ne ' ' )) {
212
+ if ((composer global show $prefix$tool $tool_version - a 2>&1 | findstr ' ^type *: *composer-plugin' ) -and ($composer_args -ne ' ' )) {
209
213
composer global config -- no- plugins allow- plugins." $prefix$tool " true > $null 2>&1
210
214
}
211
215
composer global require $prefix$release $composer_args > $null 2>&1
Original file line number Diff line number Diff line change @@ -160,9 +160,10 @@ add_composertool_helper() {
160
160
scope=$4
161
161
composer_args=$5
162
162
enable_extensions curl mbstring openssl
163
+ tool_version=${release##*: } ; [ " $tool_version " = " $tool " ] && tool_version=" *"
163
164
if [ " $scope " = " global" ]; then
164
165
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' && [ -n " $composer_args " ]; then
166
+ if composer global show " $prefix$tool " " $tool_version " -a 2>&1 | grep -qE ' ^type *: *composer-plugin' && [ -n " $composer_args " ]; then
166
167
composer global config --no-plugins allow-plugins." $prefix$tool " true > /dev/null 2>&1
167
168
fi
168
169
composer global require " $prefix$release " " $composer_args " > /dev/null 2>&1
@@ -172,7 +173,7 @@ add_composertool_helper() {
172
173
if ! [ -d " $scoped_dir " ]; then
173
174
mkdir -p " $scoped_dir "
174
175
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' && [ -n " $composer_args " ]; then
176
+ if composer show " $prefix$tool " " $tool_version " -d " $scoped_dir " -a 2>&1 | grep -qE ' ^type *: *composer-plugin' && [ -n " $composer_args " ]; then
176
177
composer config -d " $scoped_dir " --no-plugins allow-plugins." $prefix$tool " true > /dev/null 2>&1
177
178
fi
178
179
composer require " $prefix$release " -d " $scoped_dir " " $composer_args " > /dev/null 2>&1
You can’t perform that action at this time.
0 commit comments