Preserves JSON encoding must be explicit

This commit is contained in:
Ehmry - 2023-10-21 15:51:07 +01:00
parent aa67840d45
commit eba1f0254e
2 changed files with 8 additions and 4 deletions

View File

@ -3,6 +3,6 @@ bin = @["nim_lk"]
description = "Tool for generating Nim lockfiles"
license = "BSD-3-Clause"
srcDir = "src"
version = "20231020"
version = "20231021"
requires "nim >= 2.0.0", "preserves >= 20231020"
requires "nim >= 2.0.0", "preserves >= 20231021"

View File

@ -259,8 +259,12 @@ proc generateLockfile(): Preserve =
result["depends".toPreserve] = deps
proc main =
var lockInfo = generateLockfile()
var
stream = newFileStream(stdout)
lockInfo = generateLockfile()
cannonicalize(lockInfo)
stdout.writeLine lockInfo
writeText(stream, lockInfo, textJson)
writeLine(stream)
close(stream)
main()