File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,7 @@ builds:
1919 - arm64
2020 ldflags :
2121 - -s -w
22- - -X main.version={{.Version}}
23- - -X main.commit={{.Commit}}
24- - -X main.date={{.Date}}
22+ - -X github.com/node-pulse/agent/cmd.Version={{.Version}}
2523
2624archives :
2725 - id : nodepulse
Original file line number Diff line number Diff line change @@ -8,12 +8,15 @@ import (
88
99var (
1010 cfgFile string
11+ // Version is set at build time via -ldflags
12+ Version = "dev"
1113)
1214
1315// rootCmd represents the base command
1416var rootCmd = & cobra.Command {
15- Use : "nodepulse" ,
16- Short : "NodePulse Agent - Prometheus forwarder for server metrics" ,
17+ Use : "nodepulse" ,
18+ Short : "NodePulse Agent - Prometheus forwarder for server metrics" ,
19+ Version : Version ,
1720 Long : `NodePulse Agent scrapes Prometheus metrics from node_exporter and forwards them to a central dashboard.
1821
1922When called without a subcommand, it runs in foreground mode (equivalent to 'nodepulse start').` ,
You can’t perform that action at this time.
0 commit comments