summaryrefslogtreecommitdiff
path: root/internal/version/version.go
blob: 189f928dbcb7a6a0e914639702af032dea3cf6f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package version

import (
	"fmt"
	"runtime"
)

var (
	// Version is the current version of gitsyncer
	Version = "0.17.0"

	// GitCommit is the git commit hash at build time
	GitCommit = "unknown"

	// BuildDate is the date when the binary was built
	BuildDate = "unknown"

	// GoVersion is the Go version used to build
	GoVersion = runtime.Version()
)

// GetVersion returns the full version string
func GetVersion() string {
	return fmt.Sprintf("gitsyncer version %s (commit: %s, built: %s, go: %s)",
		Version, GitCommit, BuildDate, GoVersion)
}

// GetShortVersion returns just the version number
func GetShortVersion() string {
	return Version
}