2020-04-22 07:53:02 +02:00
|
|
|
{.push raises: [Defect].}
|
|
|
|
|
2020-06-30 14:23:52 +02:00
|
|
|
import strutils
|
|
|
|
|
2020-04-16 00:20:27 +02:00
|
|
|
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
|
|
|
|
2020-04-16 00:20:27 +02:00
|
|
|
const
|
2019-03-06 00:54:08 +02:00
|
|
|
versionMajor* = 0
|
2020-06-30 14:23:52 +02:00
|
|
|
versionMinor* = 5
|
2019-05-14 16:31:19 +03:00
|
|
|
versionBuild* = 0
|
2019-03-06 00:54:08 +02:00
|
|
|
|
2019-10-23 13:44:31 +03:00
|
|
|
useInsecureFeatures* = defined(insecure)
|
2019-09-07 13:48:05 -04:00
|
|
|
|
2019-11-08 11:33:16 +01:00
|
|
|
gitRevision* = staticExec("git rev-parse --short HEAD")
|
|
|
|
|
2020-04-16 00:20:27 +02:00
|
|
|
nimBanner* = staticExec("nim --version")
|
|
|
|
|
2019-11-12 00:05:35 +00:00
|
|
|
versionAsStr* =
|
|
|
|
$versionMajor & "." & $versionMinor & "." & $versionBuild
|
2019-03-06 00:54:08 +02:00
|
|
|
|
2019-11-12 00:05:35 +00:00
|
|
|
fullVersionStr* =
|
2020-03-22 22:54:47 +02:00
|
|
|
versionAsStr & " (" & gitRevision & ")"
|
2020-06-30 14:23:52 +02:00
|
|
|
|
|
|
|
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]
|
2020-06-29 20:30:19 +03:00
|
|
|
|