fix(KRITISCH): Exclude strikt als Array (verifiziert mit echtem PowerShell)
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
# StatusQuo_Updates/scripts/rollback.ps1
|
||||
# Kanonisches Rollback-Skript (Referenz). Die ausgelieferte rollback.bat enthaelt
|
||||
# diese Logik EINGEBETTET und laeuft damit vollstaendig OFFLINE (kein Netz noetig).
|
||||
# Erwartet im aufrufenden Scope: $root, $stopBat, $startBat
|
||||
# Beachtet .backupignore (grosse Content-Ordner, die nie veraendert werden).
|
||||
# Kanonisches Rollback-Skript (Referenz). rollback.bat enthaelt diese Logik
|
||||
# EINGEBETTET und laeuft vollstaendig OFFLINE. Beachtet .backupignore.
|
||||
# Erwartet im Scope: $root, $stopBat, $startBat
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
# Erwartet im Scope: $root, $stopBat, $startBat
|
||||
@@ -14,9 +13,11 @@ $_startName = if ($null -ne $startBat) { $startBat } else { 'dgl.bat' }
|
||||
$_excl = @('.backup')
|
||||
$_ignoreFile = Join-Path $root '.backupignore'
|
||||
if (Test-Path -LiteralPath $_ignoreFile) {
|
||||
$_excl += (Get-Content -LiteralPath $_ignoreFile | ForEach-Object { $_.Trim() } |
|
||||
$_extra = @(Get-Content -LiteralPath $_ignoreFile | ForEach-Object { $_.Trim() } |
|
||||
Where-Object { $_ -ne '' -and -not $_.StartsWith('#') })
|
||||
$_excl = $_excl + $_extra
|
||||
}
|
||||
$_excl = @($_excl) # strikt als Array (verhindert Skalar-Entpackung)
|
||||
|
||||
$bk = Join-Path $root '.backup'
|
||||
if (-not (Test-Path -LiteralPath $bk)) {
|
||||
|
||||
Reference in New Issue
Block a user