mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-17 10:17:44 -06:00
Remove the Need to add 'WPFInstall' for every App Entry Name in 'applications.json' File
This commit is contained in:
parent
08847099b4
commit
bea7726587
13
Compile.ps1
13
Compile.ps1
@ -74,6 +74,19 @@ Get-ChildItem .\config | Where-Object {$psitem.extension -eq ".json"} | ForEach-
|
||||
$jsonAsObject.$firstLevelName.description = $jsonAsObject.$firstLevelName.description.replace('''',"'") # resolves the Double Apostrophe caused by the first replace function in the main loop
|
||||
}
|
||||
}
|
||||
|
||||
# Add 'WPFInstall' as a prefix to every entry-name in 'applications.json' file
|
||||
if ($psitem.Name -eq "applications.json") {
|
||||
for ($i = 0; $i -lt $firstLevelJsonList.Count; $i += 1) {
|
||||
$appEntryName = $firstLevelJsonList[$i]
|
||||
$appEntryContent = $jsonAsObject.$appEntryName
|
||||
# Remove the entire app entry, so we could add it later with a different name
|
||||
$jsonAsObject.PSObject.Properties.Remove($appEntryName)
|
||||
# Add the app entry, but with a different name (WPFInstall + The App Entry Name)
|
||||
$jsonAsObject | Add-Member -MemberType NoteProperty -Name "WPFInstall$appEntryName" -Value $appEntryContent
|
||||
}
|
||||
}
|
||||
|
||||
# The replace at the end is required, as without it the output of 'converto-json' will be somewhat weird for Multiline Strings
|
||||
# Most Notably is the scripts in some json files, making it harder for users who want to review these scripts, which're found in the compiled script
|
||||
$json = ($jsonAsObject | convertto-json -Depth 3).replace('\r\n',"`r`n")
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user