Don't automatically include "v" from git

- "v" should not be part of the version (softwareVer variable is used
  in other places)
- formatting
This commit is contained in:
Marcel van der Boom 2018-11-20 18:14:02 +01:00
parent c25d0bef67
commit b030921691
2 changed files with 4 additions and 5 deletions

View File

@ -1,4 +1,4 @@
GITREV=`git describe --tags` GITREV=`git describe --tags | cut -c 2-`
LDFLAGS=-ldflags="-X 'github.com/writeas/writefreely.softwareVer=$(GITREV)'" LDFLAGS=-ldflags="-X 'github.com/writeas/writefreely.softwareVer=$(GITREV)'"
GOCMD=go GOCMD=go
@ -32,6 +32,6 @@ ui : force_look
clean : clean :
cd less/; $(MAKE) clean $(MFLAGS) cd less/; $(MAKE) clean $(MFLAGS)
force_look : force_look :
true true

5
app.go
View File

@ -36,8 +36,7 @@ const (
) )
// Software version can be set from git env using -ldflags // Software version can be set from git env using -ldflags
var softwareVer = "v0.3" var softwareVer = "0.3"
var ( var (
debugging bool debugging bool
@ -135,7 +134,7 @@ func pageForReq(app *app, r *http.Request) page.StaticPage {
p := page.StaticPage{ p := page.StaticPage{
AppCfg: app.cfg.App, AppCfg: app.cfg.App,
Path: r.URL.Path, Path: r.URL.Path,
Version: softwareVer, Version: "v" + softwareVer,
} }
// Add user information, if given // Add user information, if given