-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: CCIE-1782: add hvm version command (#2702)
* Add stub version command * Add .idea * go mod tidy to merge * Use util.GetVersion to get happy version * go mod tidy * ci - update ent schema * ci - update go.mod --------- Co-authored-by: David Spadea <dspadea@chanzuckerberg.com> Co-authored-by: czi-github-helper[bot] <czi-github-helper[bot]@users.noreply.github.com>
- Loading branch information
1 parent
fa22077
commit 82efc14
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,5 @@ | |
.terraform/ | ||
|
||
.DS_Store | ||
|
||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
HVM Version Commands | ||
*/ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"github.com/chanzuckerberg/happy/shared/util" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// installCmd represents the install command | ||
var versionCmd = &cobra.Command{ | ||
Use: "version", | ||
Short: "Output version of HVM", | ||
Long: `Output the current version of the HVM CLI`, | ||
RunE: outputVersion, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(versionCmd) | ||
} | ||
|
||
func outputVersion(cmd *cobra.Command, args []string) error { | ||
v := util.GetVersion().String() | ||
fmt.Fprintln(cmd.OutOrStdout(), v) | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters