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