| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | set -euo pipefail |
| 3 | |
| 4 | commit="$(gitscip-shell system . . git. rev-parse HEAD 2>/dev/nullscip-shell filesystem . . `/dev/null`. || truescip-shell system . . true.)" |
| 5 | remote="$(gitscip-shell system . . git. config --get remote.origin.url 2>/dev/nullscip-shell filesystem . . `/dev/null`. || truescip-shell system . . true.)" |
| 6 | dirty="0" |
| 7 | if ! gitscip-shell system . . git. diff --quiet 2>/dev/nullscip-shell filesystem . . `/dev/null`. || ! gitscip-shell system . . git. diff --cached --quiet 2>/dev/nullscip-shell filesystem . . `/dev/null`.; then |
| 8 | dirty="1" |
| 9 | fi |
| 10 | |
| 11 | if [[ -n "$commit" ]]; then |
| 12 | printfscip-shell system . . printf. 'STABLE_BUILD_SCM_REVISION %s\n' "$commit" |
| 13 | fi |
| 14 | if [[ -n "$remote" ]]; then |
| 15 | printfscip-shell system . . printf. 'STABLE_BUILD_SCM_REMOTE %s\n' "$remote" |
| 16 | fi |
| 17 | printfscip-shell system . . printf. 'STABLE_BUILD_SCM_DIRTY %s\n' "$dirty" |
| 18 | printfscip-shell system . . printf. 'BUILD_TIMESTAMP %s\n' "$(datescip-shell system . . date. -u +%s)" |