summaryrefslogtreecommitdiff
path: root/internal/version
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-06-23 17:13:45 +0300
committerPaul Buetow <paul@buetow.org>2025-06-23 17:13:45 +0300
commit97e0151ba6a260195ced76ab69d3e3bd58ba68fc (patch)
treecf158f895aa353ba9a6308358f4c333924bcfa14 /internal/version
Initial gitsyncer implementation with version support
- Initialize Go module for github.com/paul/gitsyncer - Add version package with version info (v0.1.0) - Implement main.go with --version flag support - Create comprehensive Taskfile.yaml for build automation - Add CLAUDE.md with project documentation The binary can be built with 'task' or 'go build -o gitsyncer ./cmd/gitsyncer' 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'internal/version')
-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