Skip to content

Commit 154c4dc

Browse files
committed
Update uninstall scripts
1 parent e67986e commit 154c4dc

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

.github/scripts/uninstall-dotnet-macos

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,21 @@ curl -L -o "$filename" "$download_url"
1010
tar -xzf "$filename"
1111
uninstall_tool_path=$(find . -name dotnet-core-uninstall)
1212
chmod +x "$tool_path"
13+
# wait for the tool to be ready
14+
max_retries=30
15+
retry=0
16+
while [[ ! -f "$uninstall_tool_path" && $retry -lt $max_retries ]]; do
17+
sleep 1
18+
((retry++))
19+
done
20+
if [[ $retry -eq $max_retries ]]; then
21+
echo "Uninstall tool was not found after $max_retries seconds." >&2
22+
cat "log.txt"
23+
exit 1
24+
fi
1325

1426
# Perform uninstall
15-
"$uninstall_tool_path" remove --yes --force --all --aspnet-runtime
16-
"$uninstall_tool_path" remove --yes --force --all --hosting-bundle
17-
"$uninstall_tool_path" remove --yes --force --all --runtime
18-
"$uninstall_tool_path" remove --yes --force --all --sdk
27+
"$uninstall_tool_path" remove --yes --force --all --aspnet-runtime --verbosity detailed
28+
"$uninstall_tool_path" remove --yes --force --all --hosting-bundle --verbosity detailed
29+
"$uninstall_tool_path" remove --yes --force --all --runtime --verbosity detailed
30+
"$uninstall_tool_path" remove --yes --force --all --sdk --verbosity detailed

.github/scripts/uninstall-dotnet-windows.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ while (-not (Test-Path $uninstallToolPath) -and ($retry -lt $maxRetries)) {
1717
}
1818
if ($retry -eq $maxRetries) {
1919
Write-Error "Uninstall tool was not found after $maxRetries seconds."
20+
Get-Content -Path "log.txt" | Write-Host
2021
exit 1
2122
}
2223

2324
# Perform uninstall
24-
& $uninstallToolPath remove --yes --force --all --aspnet-runtime
25-
& $uninstallToolPath remove --yes --force --all --hosting-bundle
26-
& $uninstallToolPath remove --yes --force --all --runtime
27-
& $uninstallToolPath remove --yes --force --all --sdk
25+
& $uninstallToolPath remove --yes --force --all --aspnet-runtime --verbosity detailed
26+
& $uninstallToolPath remove --yes --force --all --hosting-bundle --verbosity detailed
27+
& $uninstallToolPath remove --yes --force --all --runtime --verbosity detailed
28+
& $uninstallToolPath remove --yes --force --all --sdk --verbosity detailed

0 commit comments

Comments
 (0)