File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 99 "log/slog"
1010 "os"
1111 "path/filepath"
12+ "runtime/debug"
1213
1314 tea "github.com/charmbracelet/bubbletea"
1415 "github.com/maniac-en/req/internal/backend/collections"
3839
3940var Version = "dev"
4041
42+ func getVersion () string {
43+ // Try to get version from build info (works with go install)
44+ if info , ok := debug .ReadBuildInfo (); ok {
45+ if info .Main .Version != "" && info .Main .Version != "(devel)" {
46+ return info .Main .Version
47+ }
48+ }
49+
50+ // Fall back to injected version (release builds)
51+ return Version
52+ }
53+
4154func initPaths () error {
4255 // setup paths using OS-appropriate cache directory
4356 userHomeDir , err := os .UserHomeDir ()
@@ -141,7 +154,7 @@ func main() {
141154 endpointsManager ,
142155 httpManager ,
143156 historyManager ,
144- Version ,
157+ getVersion () ,
145158 )
146159
147160 // populate dummy data for demo
You can’t perform that action at this time.
0 commit comments