Skip to content

Commit dd31d70

Browse files
committed
fix: update ldflags to reference correct package for versioning
1 parent 046cfe1 commit dd31d70

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.goreleaser.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff 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

2624
archives:
2725
- id: nodepulse

cmd/root.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ import (
88

99
var (
1010
cfgFile string
11+
// Version is set at build time via -ldflags
12+
Version = "dev"
1113
)
1214

1315
// rootCmd represents the base command
1416
var 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
1922
When called without a subcommand, it runs in foreground mode (equivalent to 'nodepulse start').`,

0 commit comments

Comments
 (0)