mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-14 06:35:51 -06:00
compile refactor
This commit is contained in:
parent
4de1ac39ef
commit
7bfcd7cb25
22
Compile.ps1
22
Compile.ps1
@ -24,15 +24,14 @@ Get-ChildItem .\functions -Recurse -File | ForEach-Object {
|
||||
Get-Content $psitem.FullName | Out-File ./$scriptname -Append -Encoding ascii
|
||||
}
|
||||
|
||||
$xaml = (Get-Content .\xaml\inputXML.xaml).replace("'","''")
|
||||
Write-output "`$inputXML = '$xaml'" | Out-File ./$scriptname -Append -Encoding ascii
|
||||
|
||||
Get-ChildItem .\config | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object {
|
||||
$json = (Get-Content $psitem.FullName).replace("'","''")
|
||||
$sync.configs.$($psitem.BaseName) = $json | convertfrom-json
|
||||
Write-output "`$sync.configs.$($psitem.BaseName) = '$json' `| convertfrom-json" | Out-File ./$scriptname -Append -Encoding ascii
|
||||
}
|
||||
|
||||
$xaml = (Get-Content .\xaml\inputXML.xaml).replace("'","''")
|
||||
|
||||
# Dot-source the Get-TabXaml function
|
||||
. .\functions\private\Get-TabXaml.ps1
|
||||
|
||||
@ -44,4 +43,21 @@ $tabColumns | Out-File -FilePath ".\xaml\inputTweaks.xaml" -Encoding ascii
|
||||
$tabColumns = Get-TabXaml "feature"
|
||||
$tabColumns | Out-File -FilePath ".\xaml\inputFeatures.xaml" -Encoding ascii
|
||||
|
||||
# Assuming inputApp.xaml is in the same directory as main.ps1
|
||||
$appXamlPath = Join-Path -Path $PSScriptRoot -ChildPath "xaml/inputApp.xaml"
|
||||
$tweaksXamlPath = Join-Path -Path $PSScriptRoot -ChildPath "xaml/inputTweaks.xaml"
|
||||
$featuresXamlPath = Join-Path -Path $PSScriptRoot -ChildPath "xaml/inputFeatures.xaml"
|
||||
|
||||
# Load the XAML content from inputApp.xaml
|
||||
$appXamlContent = Get-Content -Path $appXamlPath -Raw
|
||||
$tweaksXamlContent = Get-Content -Path $tweaksXamlPath -Raw
|
||||
$featuresXamlContent = Get-Content -Path $featuresXamlPath -Raw
|
||||
|
||||
# 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
|
||||
|
||||
Write-output "`$inputXML = '$xaml'" | Out-File ./$scriptname -Append -Encoding ascii
|
||||
|
||||
Get-Content .\scripts\main.ps1 | Out-File ./$scriptname -Append -Encoding ascii
|
@ -52,22 +52,6 @@ $sync.runspace.Open()
|
||||
|
||||
$inputXML = $inputXML -replace 'mc:Ignorable="d"', '' -replace "x:N", 'N' -replace '^<Win.*', '<Window'
|
||||
|
||||
# Assuming inputApp.xaml is in the same directory as main.ps1
|
||||
$appXamlPath = Join-Path -Path $PSScriptRoot -ChildPath "xaml/inputApp.xaml"
|
||||
$tweaksXamlPath = Join-Path -Path $PSScriptRoot -ChildPath "xaml/inputTweaks.xaml"
|
||||
$featuresXamlPath = Join-Path -Path $PSScriptRoot -ChildPath "xaml/inputFeatures.xaml"
|
||||
|
||||
# Load the XAML content from inputApp.xaml
|
||||
$appXamlContent = Get-Content -Path $appXamlPath -Raw
|
||||
$tweaksXamlContent = Get-Content -Path $tweaksXamlPath -Raw
|
||||
$featuresXamlContent = Get-Content -Path $featuresXamlPath -Raw
|
||||
|
||||
# Replace the placeholder in $inputXML with the content of inputApp.xaml
|
||||
$inputXML = $inputXML -replace "{{InstallPanel_applications}}", $appXamlContent
|
||||
$inputXML = $inputXML -replace "{{InstallPanel_tweaks}}", $tweaksXamlContent
|
||||
$inputXML = $inputXML -replace "{{InstallPanel_features}}", $featuresXamlContent
|
||||
|
||||
|
||||
if ((Get-WinUtilToggleStatus WPFToggleDarkMode) -eq $True) {
|
||||
$ctttheme = 'Matrix'
|
||||
}
|
||||
|
2946
winutil.ps1
2946
winutil.ps1
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user