Skip to content

Commit cc9c51d

Browse files
authored
Use Regex instead of parsing JsonObject
1 parent b729cb1 commit cc9c51d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Scripts/post_build.ps1

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,8 @@ function Delete-Unused ($path, $config) {
5050
function Remove-CreateDumpExe ($path, $config) {
5151
$target = "$path\Output\$config"
5252

53-
$depjson = Get-Content $target\Flow.Launcher.deps.json -raw |ConvertFrom-Json -depth 32
54-
$depjson.targets.'.NETCoreApp,Version=v5.0/win-x64'.'runtimepack.Microsoft.NETCore.App.Runtime.win-x64/5.0.6'.native.PSObject.Properties.Remove("createdump.exe")
55-
$depjson|ConvertTo-Json -Depth 32|Out-File $target\Flow.Launcher.deps.json
56-
Remove-Item -Path $target -Include "*createdump.exe" -Recurse
53+
$depjson = Get-Content $target\Flow.Launcher.deps.json -raw
54+
$depjson -replace '(?s)(.createdump.exe": {.*?}.*?\n)\s*', "" | Out-File $target\Flow.Launcher.deps.json
5755
}
5856

5957

@@ -127,4 +125,4 @@ function Main {
127125
}
128126
}
129127

130-
Main
128+
Main

0 commit comments

Comments
 (0)