From fcc1bdedda8160cf54e23cdd66155010fc07b004 Mon Sep 17 00:00:00 2001 From: Aaron Prindle Date: Thu, 6 Apr 2017 14:01:16 -0700 Subject: [PATCH] Removed .minikube folder creation from version command --- cmd/minikube/cmd/root.go | 42 ++++++++++++++++++------------------- cmd/minikube/cmd/version.go | 2 -- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/cmd/minikube/cmd/root.go b/cmd/minikube/cmd/root.go index f1a50fbc41..4f36988322 100644 --- a/cmd/minikube/cmd/root.go +++ b/cmd/minikube/cmd/root.go @@ -84,27 +84,6 @@ var RootCmd = &cobra.Command{ Please use --v=3 to show libmachine logs, and --v=7 for debug level libmachine logs `) } - - //TODO(r2d4): config should not reference API - clientType = configCmd.GetClientType() - - // Log level 3 or greater enables libmachine logs - if !glog.V(3) { - log.SetOutWriter(ioutil.Discard) - log.SetErrWriter(ioutil.Discard) - } - - // Log level 7 or greater enables debug level logs - if glog.V(7) { - log.SetDebug(true) - } - - if enableUpdateNotification { - notify.MaybePrintUpdateTextFromGithub(os.Stderr) - } - if enableKubectlDownloadMsg { - util.MaybePrintKubectlDownloadMsg(runtime.GOOS, os.Stderr) - } }, } @@ -143,6 +122,27 @@ func init() { } viper.BindPFlags(RootCmd.PersistentFlags()) cobra.OnInitialize(initConfig) + + //TODO(r2d4): config should not reference API + clientType = configCmd.GetClientType() + + // Log level 3 or greater enables libmachine logs + if !glog.V(3) { + log.SetOutWriter(ioutil.Discard) + log.SetErrWriter(ioutil.Discard) + } + + // Log level 7 or greater enables debug level logs + if glog.V(7) { + log.SetDebug(true) + } + + if enableUpdateNotification { + notify.MaybePrintUpdateTextFromGithub(os.Stderr) + } + if enableKubectlDownloadMsg { + util.MaybePrintKubectlDownloadMsg(runtime.GOOS, os.Stderr) + } } // initConfig reads in config file and ENV variables if set. diff --git a/cmd/minikube/cmd/version.go b/cmd/minikube/cmd/version.go index 88894eda8b..684b4cb00c 100644 --- a/cmd/minikube/cmd/version.go +++ b/cmd/minikube/cmd/version.go @@ -31,8 +31,6 @@ var versionCmd = &cobra.Command{ PersistentPreRun: func(cmd *cobra.Command, args []string) { // Explicitly disable update checking for the version command enableUpdateNotification = false - - RootCmd.PersistentPreRun(cmd, args) }, Run: func(command *cobra.Command, args []string) {