nimbus-eth2/beacon_chain/version.nim

41 lines
1007 B
Nim
Raw Normal View History

{.push raises: [Defect].}
import strutils
when not defined(nimscript):
import times
let copyrights* = "Copyright (c) 2019-" & $(now().utc.year) & " Status Research & Development GmbH"
2019-11-11 14:43:12 +00:00
const
versionMajor* = 0
versionMinor* = 6
versionBuild* = 0
2020-11-09 12:37:58 +00:00
versionBlob* = "hope" # Single word - ends up in the default graffitti
useInsecureFeatures* = defined(insecure)
gitRevision* = staticExec("git rev-parse --short HEAD")
2020-11-07 07:46:53 +00:00
nimBanner* = staticExec("nim --version | grep -v Compiled")
versionAsStr* =
$versionMajor & "." & $versionMinor & "." & $versionBuild
fullVersionStr* = "v" & versionAsStr & "-" & gitRevision
func shortNimBanner*(): string =
const gitPrefix = "git hash: "
let tmp = splitLines(nimBanner)
if tmp.len == 0:
return
var gitHash = ""
for line in tmp:
if line.startsWith(gitPrefix) and line.len > 8 + gitPrefix.len:
gitHash = line[gitPrefix.len..<gitPrefix.len + 8]
if gitHash.len > 0:
tmp[0] & " (" & gitHash & ")"
else:
tmp[0]