diff --git a/ScriptCore/postbuild.ps1 b/ScriptCore/postbuild.ps1 index 8358158..8431562 100644 --- a/ScriptCore/postbuild.ps1 +++ b/ScriptCore/postbuild.ps1 @@ -5,18 +5,20 @@ param [string]$destinationDir ) -# Überprüfe, ob die Verzeichnisse existieren -if ((Test-Path -Path $sourceDir) -and (Test-Path -Path $destinationDir)) +if (-not (Test-Path -Path $sourceDir)) { - - # Gebe die Pfadinformationen aus - Write-Host "Kopiere Dateien von $sourceDir nach $destinationDir" - - # Kopiere alle Dateien vom Quell- zum Zielverzeichnis - Get-ChildItem -Path $sourceDir -File | ForEach-Object { Copy-Item -Path $_.FullName -Destination $destinationDir } - + Write-Host "Source directory $sourceDir doesn't exist." + exit } -else + +# Create destination if necessary +if (-not (Test-Path -Path $destinationDir)) { - Write-Host "Ein oder beide Verzeichnisse existieren nicht." -} \ No newline at end of file + New-Item -ItemType Directory -Force -Path $destinationDir +} + +# Gebe die Pfadinformationen aus +Write-Host "Kopiere Dateien von $sourceDir nach $destinationDir" + +# Copy all files from source folder to the destination folder +Copy-Item -Path "$sourceDir\*" -Destination $destinationDir -Recurse \ No newline at end of file