Fix to not break existing tools if they fail to setup

This commit is contained in:
Shivam Mathur
2021-12-27 23:06:24 +05:30
parent 092944b039
commit 3681a25ab6
2 changed files with 10 additions and 4 deletions

View File

@ -371,7 +371,7 @@ Function Add-Tool() {
$ver_param
)
if (Test-Path $bin_dir\$tool) {
Remove-Item $bin_dir\$tool
Copy-Item $bin_dir\$tool -Destination $bin_dir\$tool.old -Force
}
if($url.Count -gt 1) {
$url = $url[0]
@ -404,6 +404,8 @@ Function Add-Tool() {
} else {
if($tool -eq "composer") {
$env:fail_fast = 'true'
} elseif (Test-Path $bin_dir\$tool.old) {
Copy-Item $bin_dir\$tool.old -Destination $bin_dir\$tool -Force
}
Add-Log $cross $tool "Could not add $tool"
}