diff --git a/Tools/GacBuild.ps1 b/Tools/GacBuild.ps1 index aa0d86a5..86098179 100644 --- a/Tools/GacBuild.ps1 +++ b/Tools/GacBuild.ps1 @@ -56,8 +56,10 @@ try { throw "Input does not exist: $FileName" } $FileName = (Resolve-Path -Path $FileName).Path - Remove-Item -Path "$($FileName).log" -Recurse | Out-Null - New-Item -ItemType Directory "$($FileName).log" | Out-Null + if (Test-Path -Path "$($FileName).log") { + Remove-Item -Path "$($FileName).log" -Recurse | Out-Null + New-Item -ItemType Directory "$($FileName).log" | Out-Null + } EnumerateResourceFiles $FileName if (-not (Test-Path -Path "$($FileName).log\ResourceFiles.txt")) { diff --git a/Tools/GacClear.ps1 b/Tools/GacClear.ps1 index 0fb2b967..217c0ad7 100644 --- a/Tools/GacClear.ps1 +++ b/Tools/GacClear.ps1 @@ -20,8 +20,10 @@ try { throw "Input does not exist: $FileName" } $FileName = (Resolve-Path -Path $FileName).Path - Remove-Item -Path "$($FileName).log" -Recurse | Out-Null - New-Item -ItemType Directory "$($FileName).log" | Out-Null + if (Test-Path -Path "$($FileName).log") { + Remove-Item -Path "$($FileName).log" -Recurse | Out-Null + New-Item -ItemType Directory "$($FileName).log" | Out-Null + } EnumerateResourceFiles $FileName if (-not (Test-Path -Path "$($FileName).log\ResourceFiles.txt")) {