diff --git a/cmd/eibc/init/init.go b/cmd/eibc/init/init.go index d527c52d..02f0c103 100644 --- a/cmd/eibc/init/init.go +++ b/cmd/eibc/init/init.go @@ -109,6 +109,13 @@ func Cmd() *cobra.Command { return } + err = eibcutils.CreateMongoDbContainer() + if err != nil { + pterm.Error.Println("failed to create mongodb container:", err) + return + } + pterm.Info.Println("created eibc mongodb container") + pterm.Info.Println("eibc config updated successfully") pterm.Info.Printf( "eibc client initialized successfully at %s\n", diff --git a/cmd/eibc/start/start.go b/cmd/eibc/start/start.go index b8505e99..2306119e 100644 --- a/cmd/eibc/start/start.go +++ b/cmd/eibc/start/start.go @@ -1,8 +1,6 @@ package start import ( - "fmt" - "log" "os" "path/filepath" @@ -30,27 +28,14 @@ func Cmd() *cobra.Command { } if !ok { - fmt.Println("eibc home directory not present, running init") - c := eibcutils.GetInitCmd() - - _, err := bash.ExecCommandWithStdout(c) - if err != nil { - return - } - - err = eibcutils.EnsureWhaleAccount() - if err != nil { - log.Printf("failed to create whale account: %v\n", err) - return - } - } - - err = eibcutils.CreateMongoDbContainer() - if err != nil { - pterm.Error.Println("failed to create mongodb container:", err) + pterm.Error.Println("eibc client not initialized") + pterm.Info.Printf( + "run %s to initialize the eibc client\n", + pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()). + Sprintf("roller eibc init"), + ) return } - pterm.Info.Println("created eibc mongodb container") c := eibcutils.GetStartCmd() err = bash.ExecCmdFollow(c)