From 473f04ddc56fde9c777ca3b6d0649650c5d24a0b Mon Sep 17 00:00:00 2001 From: MyDrift Date: Tue, 10 Sep 2024 03:21:50 +0200 Subject: [PATCH] [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 --- Compile.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Compile.ps1 b/Compile.ps1 index c9d43555..b7a61558 100644 --- a/Compile.ps1 +++ b/Compile.ps1 @@ -4,6 +4,11 @@ param ( [switch]$SkipPreprocessing, [string]$Arguments ) + +if ((Get-Item ".\winutil.ps1" -ErrorAction SilentlyContinue).IsReadOnly) { + Remove-Item ".\winutil.ps1" -Force +} + $OFS = "`r`n" $scriptname = "winutil.ps1" $workingdir = $PSScriptRoot