Skip to content

Commit

Permalink
Add target to build information
Browse files Browse the repository at this point in the history
  • Loading branch information
gzuidhof committed Nov 18, 2020
1 parent 3267373 commit 8deba71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion starboard/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ builds:
# Custom ldflags templates.
# Default is `-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser`.
ldflags:
- -s -w -X github.com/gzuidhof/starboard-cli/starboard/cmd.version={{.Version}} -X github.com/gzuidhof/starboard-cli/starboard/cmd.commit={{.Commit}} -X github.com/gzuidhof/starboard-cli/starboard/cmd.date={{.Date}}
- -s -w -X github.com/gzuidhof/starboard-cli/starboard/cmd.version={{.Version}} -X github.com/gzuidhof/starboard-cli/starboard/cmd.commit={{.Commit}} -X github.com/gzuidhof/starboard-cli/starboard/cmd.date={{.CommitDate}} -X github.com/gzuidhof/starboard-cli/starboard/cmd.target={{.Env.GOOS}}
3 changes: 2 additions & 1 deletion starboard/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var cfgFile string
var version = "<unknown>"
var date = "date unknown"
var commit = ""
var target = ""

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Expand Down Expand Up @@ -51,7 +52,7 @@ func init() {

rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.starboard.yaml)")

rootCmd.Version = version + " (" + date + ") " + commit
rootCmd.Version = version + " " + target + " (" + date + ") " + commit

// Cobra also supports local flags, which will only run
// when this action is called directly.
Expand Down

0 comments on commit 8deba71

Please sign in to comment.