diff --git a/VERSION b/VERSION index a3427528..1296e0f5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0-3-gf576e74 +0.1.0-4-gf49236b diff --git a/renderer/funcmap.go b/renderer/funcmap.go index 7bf77cfa..2549d4ed 100644 --- a/renderer/funcmap.go +++ b/renderer/funcmap.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "html/template" + "io/ioutil" "net/url" "reflect" "strconv" @@ -22,6 +23,7 @@ const ( var ( funcMap = template.FuncMap{ + "version": version, "toInt": toInt, "isResponseIn": isResponseIn, "query": query, @@ -65,6 +67,14 @@ var ( } ) +func version() string { + version, err := ioutil.ReadFile("./VERSION") + if err != nil { + return "" + } + return string(version) +} + func toInt(value float64) int { return int(value) }