Files
HexaHost-Frontend/scripts/sync-backend-to-public.ps1

24 lines
912 B
PowerShell

# Kopiert Backend-Includes und -Config nach public/ (für Produktions-Deploy)
$ErrorActionPreference = 'Stop'
$root = Split-Path -Parent $PSScriptRoot
$includesSrc = Join-Path $root 'backend\includes'
$configSrc = Join-Path $root 'backend\config'
$includesDst = Join-Path $root 'public\includes'
$configDst = Join-Path $root 'public\config'
if (-not (Test-Path $includesSrc)) {
throw "Backend-Includes nicht gefunden: $includesSrc"
}
if (-not (Test-Path $configSrc)) {
throw "Backend-Config nicht gefunden: $configSrc"
}
New-Item -ItemType Directory -Force -Path $includesDst | Out-Null
New-Item -ItemType Directory -Force -Path $configDst | Out-Null
Copy-Item -Path (Join-Path $includesSrc '*') -Destination $includesDst -Recurse -Force
Copy-Item -Path (Join-Path $configSrc '*') -Destination $configDst -Recurse -Force
Write-Host "OK: backend -> public/includes und public/config synchronisiert."