Automatically update a constant on every build


I wonder, what would be a simple way to update a constant on every build? My intuitive approach was like the following, but that wouldn’t work.

{{ VERSION = Time.utc }}

I’m pretty sure you can just do TIME = Time.utc. See the second codeblock in

Thank you, but if I just do TIME = Time.utc, the constant will update on every run, rather than on every build, right? I might be missing something here, though.

Ah, in that case you could use`(command):MacroId-instance-method to do like

TIME = {{ `date`.stringify }}

Of course this would require that the system that builds the binary has a date command.

What’s the use case of this? Wouldn’t it be better to follow semver and just manually update the version when a release changes something?


It works, thanks!
That’s for a really small utility, and I always forget to bump the version.