Skip to content

Commit

Permalink
fix: all "next steps" messages should be last (#1025)
Browse files Browse the repository at this point in the history
  • Loading branch information
artemijspavlovs authored Sep 22, 2024
1 parent 94dd1d0 commit e617da5
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 79 deletions.
15 changes: 9 additions & 6 deletions cmd/eibc/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,15 @@ func Cmd() *cobra.Command {
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf(eibcHome),
)
pterm.Info.Println("next steps:")
pterm.Info.Printf(
"run %s to start the eibc client in interactive mode\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller eibc start"),
)

defer func() {
pterm.Info.Println("next steps:")
pterm.Info.Printf(
"run %s to start the eibc client in interactive mode\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller eibc start"),
)
}()
},
}
return cmd
Expand Down
14 changes: 8 additions & 6 deletions cmd/relayer/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,12 +418,14 @@ func Cmd() *cobra.Command {
}
}

pterm.Info.Println("next steps:")
pterm.Info.Printf(
"run %s load the necessary systemd services\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller relayer services load"),
)
defer func() {
pterm.Info.Println("next steps:")
pterm.Info.Printf(
"run %s load the necessary systemd services\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller relayer services load"),
)
}()
},
}

Expand Down
16 changes: 9 additions & 7 deletions cmd/rollapp/config/set/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,15 @@ func Cmd() *cobra.Command {
return
}

pterm.Info.Println("next steps:")
pterm.Info.Println("if this was the only configuration value you wanted to update")
pterm.Info.Printf(
"run %s to restart the systemd services and apply the new values\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller rollapp services restart"),
)
defer func() {
pterm.Info.Println("next steps:")
pterm.Info.Println("if this was the only configuration value you wanted to update")
pterm.Info.Printf(
"run %s to restart the systemd services and apply the new values\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller rollapp services restart"),
)
}()
},
}

Expand Down
16 changes: 9 additions & 7 deletions cmd/rollapp/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,15 @@ func Cmd() *cobra.Command {
return
}

pterm.Info.Println("next steps:")
pterm.Info.Printf(
"run %s prepare node configuration for %s RollApp\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller rollapp setup"),
raID,
)
defer func() {
pterm.Info.Println("next steps:")
pterm.Info.Printf(
"run %s prepare node configuration for %s RollApp\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller rollapp setup"),
raID,
)
}()
},
}

Expand Down
17 changes: 10 additions & 7 deletions cmd/rollapp/sequencer/metadata/export/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,16 @@ func Cmd() *cobra.Command {
}

pterm.Info.Printf("metadata successfully exported to %s\n", metadataFilePath)
pterm.Info.Println("next steps:")
pterm.Info.Println("update the metadata file")
pterm.Info.Printf(
"run %s to submit a transaction to update the sequencer metadata\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller rollapp sequencer metadata update"),
)

defer func() {
pterm.Info.Println("next steps:")
pterm.Info.Println("update the metadata file")
pterm.Info.Printf(
"run %s to submit a transaction to update the sequencer metadata\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller rollapp sequencer metadata update"),
)
}()
},
}

Expand Down
14 changes: 8 additions & 6 deletions cmd/rollapp/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -733,12 +733,14 @@ func Cmd() *cobra.Command {

pterm.Info.Println("initialization complete")

pterm.Info.Println("next steps:")
pterm.Info.Printf(
"run %s load the necessary systemd services\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller rollapp services load"),
)
defer func() {
pterm.Info.Println("next steps:")
pterm.Info.Printf(
"run %s load the necessary systemd services\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller rollapp services load"),
)
}()
},
}

Expand Down
16 changes: 9 additions & 7 deletions cmd/services/load/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,15 @@ func Cmd(services []string, module string) *cobra.Command {
}
}

pterm.Info.Println("next steps:")
pterm.Info.Printf(
"run %s to start %s on your local machine\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller %s services start", module),
strings.Join(services, ", "),
)
defer func() {
pterm.Info.Println("next steps:")
pterm.Info.Printf(
"run %s to start %s on your local machine\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller %s services start", module),
strings.Join(services, ", "),
)
}()
},
}
return cmd
Expand Down
73 changes: 40 additions & 33 deletions cmd/services/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,19 @@ func RollappCmd() *cobra.Command {
return
}

pterm.Info.Println("next steps:")
pterm.Info.Printf(
"run %s to set up IBC channels and start relaying packets\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller relayer setup"),
)
pterm.Info.Printf(
"run %s to view the logs of the rollapp\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller rollapp services logs"),
)
defer func() {
pterm.Info.Println("next steps:")
pterm.Info.Printf(
"run %s to set up IBC channels and start relaying packets\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller relayer setup"),
)
pterm.Info.Printf(
"run %s to view the logs of the rollapp\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller rollapp services logs"),
)
}()
},
}
return cmd
Expand Down Expand Up @@ -77,17 +79,19 @@ func RelayerCmd() *cobra.Command {
)
}

pterm.Info.Println("next steps:")
pterm.Info.Printf(
"run %s to join the eibc market\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller eibc init"),
)
pterm.Info.Printf(
"run %s to view the current status of the relayer\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller relayer services logs"),
)
defer func() {
pterm.Info.Println("next steps:")
pterm.Info.Printf(
"run %s to join the eibc market\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller eibc init"),
)
pterm.Info.Printf(
"run %s to view the current status of the relayer\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("roller relayer services logs"),
)
}()
},
}
return cmd
Expand Down Expand Up @@ -117,18 +121,21 @@ func EibcCmd() *cobra.Command {
)
}

pterm.Info.Println("next steps:")
pterm.Info.Println(
"that's all folks",
)

if runtime.GOOS == "linux" {
pterm.Info.Printf(
"run %s to view the current status of the eibc client\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("journalctl -fu eibc"),
defer func() {
pterm.Info.Println("next steps:")
pterm.Info.Println(
"that's all folks",
)
}

if runtime.GOOS == "linux" {
pterm.Info.Printf(
"run %s to view the current status of the eibc client\n",
pterm.DefaultBasicText.WithStyle(pterm.FgYellow.ToStyle()).
Sprintf("journalctl -fu eibc"),
)
}
}()

},
}
return cmd
Expand Down

0 comments on commit e617da5

Please sign in to comment.