[fix compile] winutil used by another process (#2680)

* fix winutil used by another process

- remove winutil.ps1 if it is readonly (also works if another process is using it) to minimize failed compiles.

* fix action error

* Oops, typo

* make it more compact
This commit is contained in:
MyDrift 2024-09-10 03:21:50 +02:00 committed by GitHub
parent 95db85f791
commit 473f04ddc5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,11 @@ param (
[switch]$SkipPreprocessing, [switch]$SkipPreprocessing,
[string]$Arguments [string]$Arguments
) )
if ((Get-Item ".\winutil.ps1" -ErrorAction SilentlyContinue).IsReadOnly) {
Remove-Item ".\winutil.ps1" -Force
}
$OFS = "`r`n" $OFS = "`r`n"
$scriptname = "winutil.ps1" $scriptname = "winutil.ps1"
$workingdir = $PSScriptRoot $workingdir = $PSScriptRoot