summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/version/version.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/internal/version/version.go b/internal/version/version.go
new file mode 100644
index 0000000..79661ce
--- /dev/null
+++ b/internal/version/version.go
@@ -0,0 +1,31 @@
+package version
+
+import (
+ "fmt"
+ "runtime"
+)
+
+var (
+ // Version is the current version of gitsyncer
+ Version = "0.1.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
+} \ No newline at end of file