From 50aacbc7992720290f8a4a8696d2288d3c52a0e7 Mon Sep 17 00:00:00 2001 From: AnthonyAmanse Date: Wed, 27 Mar 2019 16:30:39 -0700 Subject: [PATCH] WIP test Signed-off-by: AnthonyAmanse --- cmd/version.go | 5 +++++ main.go | 6 +++++- utils/flags.go | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cmd/version.go b/cmd/version.go index 2d4d71057..d42ca705c 100755 --- a/cmd/version.go +++ b/cmd/version.go @@ -19,6 +19,7 @@ package cmd import ( "fmt" + "github.com/apache/incubator-openwhisk-wskdeploy/utils" "github.com/apache/incubator-openwhisk-wskdeploy/wski18n" "github.com/apache/incubator-openwhisk-wskdeploy/wskprint" @@ -38,5 +39,9 @@ var versionCmd = &cobra.Command{ // Note: no need to translate the following string // TODO(#767) - Flags.CliVersion are not set during build fmt.Sprintf("wskdeploy version: %s", utils.Flags.CliVersion)) + wskprint.PrintlnOpenWhiskOutput( + fmt.Sprintf("wskdeploy git commit: %s", utils.Flags.CliGitCommit)) + wskprint.PrintlnOpenWhiskOutput( + fmt.Sprintf("wskdeploy build date: %s", utils.Flags.CliBuildDate)) }, } diff --git a/main.go b/main.go index 54a809302..156ce5f81 100644 --- a/main.go +++ b/main.go @@ -28,9 +28,13 @@ func main() { var ( //Version ...The Version of the tool - Version = "unset" + Version = "unset" + GitCommit = "unset" + BuildDate = "unset" ) func init() { utils.Flags.CliVersion = Version + utils.Flags.CliGitCommit = GitCommit + utils.Flags.CliBuildDate = BuildDate } diff --git a/utils/flags.go b/utils/flags.go index a860850fc..3025bf64e 100644 --- a/utils/flags.go +++ b/utils/flags.go @@ -29,6 +29,8 @@ type WskDeployFlags struct { ApiVersion string // OpenWhisk version CfgFile string CliVersion string + CliGitCommit string + CliBuildDate string ProjectPath string DeploymentPath string ManifestPath string