[build-script]: strip $schema from config jsons before embedding

This commit is contained in:
psyirius 2024-08-07 06:41:05 -07:00
parent 4d7e6ded11
commit 26256e14f8

View File

@ -70,7 +70,15 @@ Get-ChildItem "$workingdir\config" | Where-Object {$psitem.extension -eq ".json"
# Replace every XML Special Character so it'll render correctly in final build
# Only do so if json files has content to be displayed (for example the applications, tweaks, features json files)
# Make an Array List containing every name at first level of Json File
$jsonAsObject = $json | convertfrom-json
[PSCustomObject]$jsonAsObject = $json | convertfrom-json
# Remove properties like $schema and such from the json object (we don't need it at this point)
@(
"`$schema"
) | ForEach-Object {
$jsonAsObject.PSObject.Properties.Remove($_) | Out-Null
}
$firstLevelJsonList = [System.Collections.ArrayList]::new()
$jsonAsObject.PSObject.Properties.Name | ForEach-Object {$null = $firstLevelJsonList.Add($_)}
# Note: