Skip to content

Commit

Permalink
Modify Compile.ps1 Handling of Xaml to Improve Maintainability (#2701)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruxunderscore authored Sep 10, 2024
1 parent d3ef94f commit 0066875
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Compile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"))

Expand Down

0 comments on commit 0066875

Please sign in to comment.