2025-02-05 10:52:15 +01:00
|
|
|
import std/strutils
|
|
|
|
|
|
|
|
|
|
proc getCrawlerVersion(): string =
|
|
|
|
|
let tag = strip(staticExec("git tag"))
|
|
|
|
|
if tag.isEmptyOrWhitespace:
|
|
|
|
|
return "untagged build"
|
|
|
|
|
return tag
|
|
|
|
|
|
|
|
|
|
proc getCrawlerRevision(): string =
|
|
|
|
|
# using a slice in a static context breaks nimsuggest for some reason
|
|
|
|
|
var res = strip(staticExec("git rev-parse --short HEAD"))
|
|
|
|
|
return res
|
|
|
|
|
|
|
|
|
|
proc getNimBanner(): string =
|
|
|
|
|
staticExec("nim --version | grep Version")
|
|
|
|
|
|
|
|
|
|
const
|
|
|
|
|
crawlerVersion* = getCrawlerVersion()
|
|
|
|
|
crawlerRevision* = getCrawlerRevision()
|
|
|
|
|
nimBanner* = getNimBanner()
|
|
|
|
|
|
|
|
|
|
crawlerFullVersion* =
|
2025-02-05 11:06:18 +01:00
|
|
|
"CodexNetworkCrawler version: " & crawlerVersion & "\p" &
|
|
|
|
|
"CodexNetworkCrawler revision: " & crawlerRevision & "\p" & nimBanner
|