Skip to content

Commit

Permalink
Improved version number
Browse files Browse the repository at this point in the history
  • Loading branch information
ninckblokje committed Jul 29, 2018
1 parent 43cfbfd commit 6d393e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Build.ps1
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
$ShortRevision = git rev-parse --short HEAD
go build -ldflags "-X main.csheetVersion=$ShortRevision" csheet.go
$Tag = git describe --tags
go build -ldflags "-X main.csheetVersion=$Tag -X main.csheetRevision=$ShortRevision" csheet.go
3 changes: 2 additions & 1 deletion csheet.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
)

var csheetFile string
var csheetRevision = "DEV-BUILD"
var csheetVersion = "DEV-BUILD"

func main() {
Expand Down Expand Up @@ -145,7 +146,7 @@ func printUsage() {
}

func printVersion() {
fmt.Printf("csheet version %s", csheetVersion)
fmt.Printf("csheet version %s, revision %s", csheetVersion, csheetRevision)
fmt.Println("")
fmt.Println("See: https://github.com/ninckblokje/csheet")
}
Expand Down

0 comments on commit 6d393e0

Please sign in to comment.