Skip to content

Commit 45838d5

Browse files
committed
fix: version info
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
1 parent 257a1c2 commit 45838d5

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ In vibe coding workflows, you run an AI coding tool in one terminal and build co
2121
go install github.com/killme2008/devtap/cmd/devtap@latest
2222
```
2323

24+
Or install via Homebrew:
25+
26+
```bash
27+
brew install killme2008/tap/devtap
28+
```
29+
2430
Or download from [GitHub Releases](https://github.com/killme2008/devtap/releases).
2531

2632
### Setup

cmd/devtap/main.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"fmt"
55
"os"
6+
"runtime/debug"
67

78
"github.com/killme2008/devtap/internal/mcp"
89
)
@@ -11,9 +12,24 @@ import (
1112
var version = "dev"
1213

1314
func main() {
15+
setVersionFromBuildInfo()
1416
mcp.ServerVersion = version
1517
if err := rootCmd().Execute(); err != nil {
1618
fmt.Fprintln(os.Stderr, err)
1719
os.Exit(1)
1820
}
1921
}
22+
23+
func setVersionFromBuildInfo() {
24+
if version != "dev" {
25+
return
26+
}
27+
info, ok := debug.ReadBuildInfo()
28+
if !ok {
29+
return
30+
}
31+
if info.Main.Version == "" || info.Main.Version == "(devel)" {
32+
return
33+
}
34+
version = info.Main.Version
35+
}

0 commit comments

Comments
 (0)