Replies: 2 comments 2 replies
-
Unfortunately, this isn't possible currently, at least not in a trivial way. Interestingly I had to do a similar operation for Nickel's release script to It might not help for your use-case, but note that if you want to override the version on-the-fly, you can use the (still experimental, but this won't probably change a lot in the future) customize mode of the CLI: $ nickel export pkg.ncl -- --override 'package.pkgver="15.0.0"'
[.. JSON export with version 15.0.0 ..] But this doesn't change Although the current parser loses some information, it still retain all expression positions, so I wonder if supporting an operation like that would be very difficult. Though I don't know right now what would be the interface - just a new subcommand to update a field in place? What if the value comes from a computation, or from merging? |
Beta Was this translation helpful? Give feedback.
-
There are only a few specific fields that you want to automatically update, right? What if you define them in a separate json file? That way you get a clear separation between the part that is automatically generated and the part that isn't:
|
Beta Was this translation helpful? Give feedback.
-
I'm interested in manipulating a Nickel document in a way that preserves comments. Is this possible?
Use case/user story:
Say I have a package specification like this:
A new version of ripgrep is released say 15.0.0 and I want to write a tool that can read the specification and update the
pkgver
andsha256
fields. Something likeuppkg 15.0.0 ripgrep.ncl
.Is this possible at the moment?
Beta Was this translation helpful? Give feedback.
All reactions