From cc9c51d8998bcaf16d67d01e78a19494f7acfc92 Mon Sep 17 00:00:00 2001 From: Kevin Zhang <45326534+taooceros@users.noreply.github.com> Date: Mon, 28 Jun 2021 11:03:09 +0800 Subject: [PATCH] Use Regex instead of parsing JsonObject --- Scripts/post_build.ps1 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1 index 8a03d6739..7f089a440 100644 --- a/Scripts/post_build.ps1 +++ b/Scripts/post_build.ps1 @@ -50,10 +50,8 @@ function Delete-Unused ($path, $config) { function Remove-CreateDumpExe ($path, $config) { $target = "$path\Output\$config" - $depjson = Get-Content $target\Flow.Launcher.deps.json -raw |ConvertFrom-Json -depth 32 - $depjson.targets.'.NETCoreApp,Version=v5.0/win-x64'.'runtimepack.Microsoft.NETCore.App.Runtime.win-x64/5.0.6'.native.PSObject.Properties.Remove("createdump.exe") - $depjson|ConvertTo-Json -Depth 32|Out-File $target\Flow.Launcher.deps.json - Remove-Item -Path $target -Include "*createdump.exe" -Recurse + $depjson = Get-Content $target\Flow.Launcher.deps.json -raw + $depjson -replace '(?s)(.createdump.exe": {.*?}.*?\n)\s*', "" | Out-File $target\Flow.Launcher.deps.json } @@ -127,4 +125,4 @@ function Main { } } -Main \ No newline at end of file +Main