diff --git a/cli/cmd/deploy.go b/cli/cmd/deploy.go index fa675c64e3..cfa9ab3cc1 100644 --- a/cli/cmd/deploy.go +++ b/cli/cmd/deploy.go @@ -17,7 +17,7 @@ import ( var deployToProfile string func init() { - config.InitConfig() + config.Init() for k := range config.AvailableServices() { // deploy command diff --git a/cli/cmd/run.go b/cli/cmd/run.go index 35882d3256..8f3ea1d806 100644 --- a/cli/cmd/run.go +++ b/cli/cmd/run.go @@ -19,7 +19,7 @@ var servicesToRun string var versionToRun string func init() { - config.InitConfig() + config.Init() rootCmd.AddCommand(runCmd) diff --git a/cli/cmd/stop.go b/cli/cmd/stop.go index 35f3681cda..76cb87e4ab 100644 --- a/cli/cmd/stop.go +++ b/cli/cmd/stop.go @@ -17,7 +17,7 @@ import ( var versionToStop string func init() { - config.InitConfig() + config.Init() rootCmd.AddCommand(stopCmd) diff --git a/cli/cmd/sync.go b/cli/cmd/sync.go index a423df0da7..2cc04b8aaa 100644 --- a/cli/cmd/sync.go +++ b/cli/cmd/sync.go @@ -27,7 +27,7 @@ var excludedBlocks = []string{"build"} var remote = "elastic:master" func init() { - config.InitConfig() + config.Init() syncIntegrationsCmd.Flags().BoolVarP(&deleteRepository, "delete", "d", false, "Will delete the existing Beats repository before cloning it again (default false)") syncIntegrationsCmd.Flags().StringVarP(&remote, "remote", "r", "elastic:master", "Sets the remote for Beats, using 'user:branch' as format (i.e. elastic:master)") diff --git a/cli/config/config.go b/cli/config/config.go index 7a89748576..ecdbc0ba8b 100644 --- a/cli/config/config.go +++ b/cli/config/config.go @@ -118,6 +118,10 @@ func GetServiceConfig(service string) (Service, bool) { // Init creates this tool workspace under user's home, in a hidden directory named ".op" func Init() { + if Op != nil { + return + } + configureLogger() binaries := []string{ @@ -310,6 +314,12 @@ func extractProfileServiceConfig(op *OpConfig, box *packr.Box) error { return err } } + + log.WithFields(log.Fields{ + "file": p, + "dir": dir, + }).Trace("Extracting boxed file") + return ioutil.WriteFile(p, []byte(file.String()), 0644) }