Amber icon indicating copy to clipboard operation
Amber copied to clipboard

Include git sha in the complied header

Open lens0021 opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. Sometime I want to know what exact version is used when reading a sh script compiled using the master branch.

Describe the solution you'd like

#!/usr/bin/env bash
# Written in [Amber](https://amber-lang.com/)
# version: 0.3.5-alpha (19c3e35c6836a75e931761386616557e63e44c30)
# date: 2024-12-12 16:37:29

And shows whether the worktree is dirty.

# version: 0.3.5-alpha (19c3e35c6836a75e931761386616557e63e44c30, dirty worktree)

lens0021 avatar Dec 16 '24 02:12 lens0021

What I've found on StackOverflow recommands to executing git command before the building. https://stackoverflow.com/a/44407625/10916512

lens0021 avatar Dec 16 '24 02:12 lens0021

i think it will make sense only on development builds. theres no need for this in releases

b1ek avatar Dec 23 '24 15:12 b1ek