Skip to content

Commit

Permalink
Add version var to use with goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Dementiev committed Apr 16, 2018
1 parent 1e926dc commit 5732ce5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 2 additions & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ var (
names []string
recursive bool
strict bool
Version = "dev"
)

// rootCmd represents the base command when called without any subcommands
Expand All @@ -24,11 +23,10 @@ var rootCmd = &cobra.Command{
It gets specified parameters (possibly secret) from AWS SSM Parameter Store,
then exports them to the underlying process.
`,
Version: Version,
// Run: func(cmd *cobra.Command, args []string) {},
}

func Execute() {
func Execute(version string) {
rootCmd.Version = version
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
Expand Down
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package main

import "github.com/springload/ssm-parent/cmd"

var version = "dev"

func main() {
cmd.Execute()
cmd.Execute(version)
}

0 comments on commit 5732ce5

Please sign in to comment.