Skip to content

Commit

Permalink
feat: [#59] cmd implement version flag (#66)
Browse files Browse the repository at this point in the history
* feat: [#59] cmd implement version flag

Set the version field of the cobra command

* fix: [#59] cmd implement version flag

Update the main file to get the version from the cmd package.
  • Loading branch information
deepu9 authored Jul 8, 2024
1 parent 69852ce commit e314388
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import (
"github.com/spf13/cobra"
)

var Version = "0.7.3"

var rootCmd = &cobra.Command{
Use: "vib",
Short: "Vib is a tool to build container images from recipes using modules",
Long: "Vib is a tool to build container images from YAML recipes using modules to define the steps to build the image.",
Version: "0.7.3",
Version: Version,
}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

var (
Version = "0.6.2"
Version = cmd.Version
)

func main() {
Expand Down

0 comments on commit e314388

Please sign in to comment.