From 225441b80444c7641d1699c672416addcdd1d36a Mon Sep 17 00:00:00 2001 From: Martin Wiethan <47688561+Marterich@users.noreply.github.com> Date: Wed, 19 Jun 2024 00:03:46 +0200 Subject: [PATCH] Move the Xaml Generation of the panels to the main script --- Compile.ps1 | 24 ++++++++---------------- scripts/main.ps1 | 9 +++++++++ 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Compile.ps1 b/Compile.ps1 index 8568e1af..164a54c2 100644 --- a/Compile.ps1 +++ b/Compile.ps1 @@ -71,29 +71,21 @@ Get-ChildItem .\config | Where-Object {$PSItem.Extension -eq ".cfg"} | ForEach-O $script_content.Add($(Write-output "`$sync.configs.$($psitem.BaseName) = '$(Get-Content $PSItem.FullName)'")) } +Write-Progress -Activity "Compiling" -Status "Writing xaml" $xaml = (Get-Content .\xaml\inputXML.xaml).replace("'","''") - -# Dot-source the Get-TabXaml function -. .\functions\private\Get-TabXaml.ps1 - -Write-Progress -Activity "Compiling" -Status "Building: Xaml " -PercentComplete 75 -$appXamlContent = Get-TabXaml "applications" 5 -$tweaksXamlContent = Get-TabXaml "tweaks" -$featuresXamlContent = Get-TabXaml "feature" - - -Write-Progress -Activity "Compiling" -Status "Adding: Xaml " -PercentComplete 90 -# Replace the placeholder in $inputXML with the content of inputApp.xaml -$xaml = $xaml -replace "{{InstallPanel_applications}}", $appXamlContent -$xaml = $xaml -replace "{{InstallPanel_tweaks}}", $tweaksXamlContent -$xaml = $xaml -replace "{{InstallPanel_features}}", $featuresXamlContent - $script_content.Add($(Write-output "`$inputXML = '$xaml'")) $script_content.Add($(Get-Content .\scripts\main.ps1)) if ($Debug){ Write-Progress -Activity "Compiling" -Status "Writing debug files" -PercentComplete 95 + # Dot-source the Get-TabXaml function + . .\functions\private\Get-TabXaml.ps1 + + $appXamlContent = Get-TabXaml "applications" 5 + $tweaksXamlContent = Get-TabXaml "tweaks" + $featuresXamlContent = Get-TabXaml "feature" + $appXamlContent | Out-File -FilePath ".\xaml\inputApp.xaml" -Encoding ascii $tweaksXamlContent | Out-File -FilePath ".\xaml\inputTweaks.xaml" -Encoding ascii $featuresXamlContent | Out-File -FilePath ".\xaml\inputFeatures.xaml" -Encoding ascii diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 23978ab7..e27acd7f 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -52,6 +52,15 @@ $sync.runspace.Open() $inputXML = $inputXML -replace 'mc:Ignorable="d"', '' -replace "x:N", 'N' -replace '^