Skip to content

Commit e1d4af5

Browse files
committed
[Windows] Fix 'clean'
Automatically detect the last component number so 'clean' removes the build cache directries correctly
1 parent 3f64d99 commit e1d4af5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utils/build.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,9 +2284,9 @@ if (-not $SkipBuild) {
22842284
}
22852285

22862286
if ($Clean) {
2287-
10..27 | % { Remove-Item -Force -Recurse "$BinaryCache\$_" -ErrorAction Ignore }
2287+
10..[HostComponent].getEnumValues()[-1] | % { Remove-Item -Force -Recurse "$BinaryCache\$_" -ErrorAction Ignore }
22882288
foreach ($Arch in $WindowsSDKArchs) {
2289-
0..3 | % { Remove-Item -Force -Recurse "$BinaryCache\$($Arch.BuildID + $_)" -ErrorAction Ignore }
2289+
0..[TargetComponent].getEnumValues()[-1] | % { Remove-Item -Force -Recurse "$BinaryCache\$($Arch.BuildID + $_)" -ErrorAction Ignore }
22902290
}
22912291
}
22922292

0 commit comments

Comments
 (0)