diff --git a/bin/checkver.ps1 b/bin/checkver.ps1 index 9871d435a..a128410fb 100644 --- a/bin/checkver.ps1 +++ b/bin/checkver.ps1 @@ -17,6 +17,7 @@ if (!$app -and $update) { . "$psscriptroot\..\lib\config.ps1" . "$psscriptroot\..\lib\buckets.ps1" . "$psscriptroot\..\lib\autoupdate.ps1" +. "$psscriptroot\..\lib\json.ps1" if(!$dir) { $dir = "$psscriptroot\..\bucket" } $dir = resolve-path $dir diff --git a/lib/autoupdate.ps1 b/lib/autoupdate.ps1 index 8d8292945..004cf8404 100644 --- a/lib/autoupdate.ps1 +++ b/lib/autoupdate.ps1 @@ -84,10 +84,9 @@ function autoupdate([String] $app, $json, [String] $version) Write-Host -f DarkGreen "Writing updated $app manifest" $path = manifest_path $app - <# - TODO improve json formatting - #> - $json | convertto-json | out-file -filepath $path -encoding utf8 + + $file_content = $json | ConvertToPrettyJson + [System.IO.File]::WriteAllLines($path, $file_content) } else { Write-Host -f DarkGray "No updates for $app" } diff --git a/lib/manifest.ps1 b/lib/manifest.ps1 index c79bc4f35..a167e67c9 100644 --- a/lib/manifest.ps1 +++ b/lib/manifest.ps1 @@ -7,7 +7,7 @@ function manifest_path($app, $bucket) { function parse_json($path) { if(!(test-path $path)) { return $null } - gc $path -raw | convertfrom-json -ea stop + gc $path -raw -Encoding UTF8 | convertfrom-json -ea stop } function url_manifest($url) {