Skip to content

Commit

Permalink
Added an optional no-output flag to roller run
Browse files Browse the repository at this point in the history
  • Loading branch information
ItayLevyOfficial committed Aug 16, 2023
1 parent c34a76e commit 16c1d10
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions cmd/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ import (
"github.com/spf13/cobra"
)

var flagNames = struct {
NoOutput string
}{
NoOutput: "no-output",
}

func Cmd() *cobra.Command {
cmd := &cobra.Command{
Use: "run",
Expand Down Expand Up @@ -47,7 +53,13 @@ func Cmd() *cobra.Command {
runRelayerWithRestarts(rollappConfig, serviceConfig)

/* ------------------------------ render output ----------------------------- */
RenderUI(rollappConfig, serviceConfig)
noOutput, err := cmd.Flags().GetBool(flagNames.NoOutput)
utils.PrettifyErrorIfExists(err)
if noOutput {
select {}
} else {
RenderUI(rollappConfig, serviceConfig)
}
cancel()
spin := utils.GetLoadingSpinner()
spin.Suffix = " Stopping rollapp services, please wait..."
Expand All @@ -57,7 +69,7 @@ func Cmd() *cobra.Command {
spin.Stop()
},
}

cmd.Flags().BoolP(flagNames.NoOutput, "", false, "Run the rollapp without rendering the UI.")
return cmd
}

Expand Down

0 comments on commit 16c1d10

Please sign in to comment.