wipe destination in _CURRENT

This commit is contained in:
Nathan
2025-08-26 15:55:21 -06:00
parent d4ad76ee97
commit 7d86cae5b1
2 changed files with 10 additions and 0 deletions

View File

@@ -8,4 +8,5 @@ set "rc=%errorlevel%"
echo PowerShell exited with RC=%rc% echo PowerShell exited with RC=%rc%
echo @"_CURRENT\_UpdateSequences.log" echo @"_CURRENT\_UpdateSequences.log"
echo Done. echo Done.
pause >nul
exit /b %rc% exit /b %rc%

View File

@@ -174,6 +174,15 @@ try {
$srcFull = $parts[1] $srcFull = $parts[1]
$seqName = $parts[2] $seqName = $parts[2]
$dstAbs = Join-Path $currentDir $seqName $dstAbs = Join-Path $currentDir $seqName
if (Test-Path -LiteralPath $dstAbs) {
"[$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')] WIPE: removing existing destination '$dstAbs'" | Add-Content -LiteralPath $logFile
try {
Remove-Item -LiteralPath $dstAbs -Recurse -Force -ErrorAction Stop
}
catch {
"[$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')] WIPE ERROR: $($_.Exception.Message)" | Add-Content -LiteralPath $logFile
}
}
if (-not (Test-Path -LiteralPath $dstAbs)) { New-Item -ItemType Directory -Path $dstAbs -Force | Out-Null } if (-not (Test-Path -LiteralPath $dstAbs)) { New-Item -ItemType Directory -Path $dstAbs -Force | Out-Null }
"[$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')] Mirror: '$srcFull' -> '$dstAbs'" | Add-Content -LiteralPath $logFile "[$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')] Mirror: '$srcFull' -> '$dstAbs'" | Add-Content -LiteralPath $logFile
$robocopyArgs = @( $robocopyArgs = @(