Modify Compile.ps1 Handling of Xaml to Improve Maintainability (#2701)

This commit is contained in:
Rux 2024-09-10 12:24:53 -07:00 committed by GitHub
parent d3ef94f175
commit 00668755c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -93,11 +93,17 @@ Get-ChildItem "config" | Where-Object {$psitem.extension -eq ".json"} | ForEach-
$script_content.Add($(Write-output "`$sync.configs.$($psitem.BaseName) = '$json' `| convertfrom-json" ))
}
$xaml = (Get-Content "xaml\inputXML.xaml").replace("'","''")
# Read the entire XAML file as a single string, preserving line breaks
$xaml = Get-Content "$workingdir\xaml\inputXML.xaml" -Raw
Update-Progress "Adding: Xaml " 90
$script_content.Add($(Write-output "`$inputXML = '$xaml'"))
# Add the XAML content to $script_content using a here-string
$script_content.Add(@"
`$inputXML = @'
$xaml
'@
"@)
$script_content.Add($(Get-Content "scripts\main.ps1"))