Fixed ScriptCore post build script to enable hot reloading for ScriptCore

This commit is contained in:
Simon Lübeß
2023-12-26 00:42:09 +01:00
parent 2f86f751a4
commit 4fa6384544
+15 -5
View File
@@ -1,4 +1,3 @@
# Definiere die Parameter $sourceDir und $destinationDir
param param
( (
[string]$sourceDir, [string]$sourceDir,
@@ -16,9 +15,20 @@ if (-not (Test-Path -Path $destinationDir))
{ {
New-Item -ItemType Directory -Force -Path $destinationDir New-Item -ItemType Directory -Force -Path $destinationDir
} }
# Gebe die Pfadinformationen aus Write-Host "Copying Files from $sourceDir to $destinationDir"
Write-Host "Kopiere Dateien von $sourceDir nach $destinationDir"
# Copy all files from source folder to the destination folder # Copy all files from source folder to the destination folder
Copy-Item -Path "$sourceDir\*" -Destination $destinationDir -Recurse Get-ChildItem -Path $sourceDir -Recurse | ForEach-Object {
$relativePath = $_.FullName.Substring((Get-Item $sourceDir).FullName.Length).TrimStart('\')
$destPath = Join-Path $destinationDir $relativePath
if (-not (Test-Path -Path (Split-Path -Path $destPath -Parent)))
{
New-Item -ItemType Directory -Force -Path (Split-Path -Path $destPath -Parent)
}
try {
Copy-Item -Path $_.FullName -Destination $destPath -ErrorAction Stop
} catch {
Write-Warning "Konnte die Datei $_.FullName nicht kopieren: $_.Exception.Message"
}
}