Skip to content

Commit

Permalink
fix: verbose for all commads
Browse files Browse the repository at this point in the history
  • Loading branch information
riyasng12 committed Jan 3, 2024
1 parent ed93085 commit 309f778
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 18 deletions.
3 changes: 1 addition & 2 deletions cli/cmd/bridge/btp/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ var runChain = map[string]func(cli *common.Cli) (*common.DiveServiceResponse, er
return nil, err
}
params := icon.GetDecentralizeParams(nodeResponse.ServiceName, nodeResponse.PrivateEndpoint, nodeResponse.KeystorePath, nodeResponse.KeyPassword, nodeResponse.NetworkId)

cli.Spinner().StartWithMessage("Starting Decentralization", "green")
cli.StartSpinnerIfNotVerbose("Starting Decentralization", common.DiveLogs)
err = icon.RunDecentralization(cli, params)
if err != nil {
return nil, err
Expand Down
5 changes: 2 additions & 3 deletions cli/cmd/chains/eth/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ func eth(cmd *cobra.Command, args []string) {
if err != nil {
cliContext.Fatalf("Error %s. %s", err, cmd.UsageString())
}

cliContext.Spinner().StartWithMessage("Starting ETH Node", "green")
cliContext.StartSpinnerIfNotVerbose("Starting ETH Node", common.DiveLogs)

responseData, err := RunEth(cliContext)
if err != nil {
Expand All @@ -51,6 +50,6 @@ func eth(cmd *cobra.Command, args []string) {
}

stopMessage := fmt.Sprintf("ETH Node Started. Please find service details in current working directory(%s)\n", serviceFileName)
cliContext.Spinner().StopWithMessage(stopMessage)
cliContext.StopSpinnerIfNotVerbose(stopMessage, common.DiveLogs)

}
4 changes: 2 additions & 2 deletions cli/cmd/chains/hardhat/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func hardhat(cmd *cobra.Command, args []string) {
cliContext.Fatalf("Error %s. %s", err, cmd.UsageString())
}

cliContext.Spinner().StartWithMessage("Starting Hardhat Node", "green")
cliContext.StartSpinnerIfNotVerbose("Starting Hardhat Node", common.DiveLogs)

responseData, err := RunHardhat(cliContext)
if err != nil {
Expand All @@ -50,6 +50,6 @@ func hardhat(cmd *cobra.Command, args []string) {
}

stopMessage := fmt.Sprintf("Hardhat Node Started. Please find service details in current working directory(%s)\n", serviceFileName)
cliContext.Spinner().StopWithMessage(stopMessage)
cliContext.StopSpinnerIfNotVerbose(stopMessage, common.DiveLogs)

}
9 changes: 4 additions & 5 deletions cli/cmd/chains/icon/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ func icon(cmd *cobra.Command, args []string) {
}

var response = &common.DiveServiceResponse{}
cliContext.StartSpinnerIfNotVerbose("Starting Icon Node", common.DiveLogs)

cliContext.Spinner().StartWithMessage("Starting Icon Node", "green")
if decentralization {
response, err = RunIconNode(cliContext)

Expand Down Expand Up @@ -99,7 +99,7 @@ func icon(cmd *cobra.Command, args []string) {
}

stopMessage := fmt.Sprintf("Icon Node Started. Please find service details in current working directory(%s)\n", serviceFileName)
cliContext.Spinner().StopWithMessage(stopMessage)
cliContext.StopSpinnerIfNotVerbose(stopMessage, common.DiveLogs)

}

Expand All @@ -112,8 +112,7 @@ func iconDecentralization(cmd *cobra.Command, args []string) {
if err != nil {
cliContext.Fatalf("Error %s. %s", err, cmd.UsageString())
}

cliContext.Spinner().StartWithMessage("Starting Icon Node Decentralization", "green")
cliContext.StartSpinnerIfNotVerbose("Starting Icon Node Decentralization", common.DiveLogs)

params := GetDecentralizeParams(serviceName, nodeEndpoint, ksPath, ksPassword, networkID)

Expand All @@ -124,5 +123,5 @@ func iconDecentralization(cmd *cobra.Command, args []string) {

}

cliContext.Spinner().StopWithMessage("Decentralization Completed")
cliContext.StopSpinnerIfNotVerbose("Decentralization Completed", common.DiveLogs)
}
6 changes: 3 additions & 3 deletions cli/cmd/chains/kusama/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ func kusama(cmd *cobra.Command, args []string) {
if err != nil {
cliContext.Fatalf("Error %s. %s", err, cmd.UsageString())
}

cliContext.Spinner().StartWithMessage("Starting Kusama Node", "green")
cliContext.StartSpinnerIfNotVerbose("Starting Kusama Node", common.DiveLogs)

response, err := RunKusama(cliContext)
if err != nil {
Expand All @@ -76,5 +75,6 @@ func kusama(cmd *cobra.Command, args []string) {
}
}
stopMessage := fmt.Sprintf("Kusama Node Started. Please find service details in current working directory(%s)\n", serviceFileName)
cliContext.Spinner().StopWithMessage(stopMessage)
cliContext.StopSpinnerIfNotVerbose(stopMessage, common.DiveLogs)

}
4 changes: 2 additions & 2 deletions cli/cmd/chains/neutron/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func neutron(cmd *cobra.Command, args []string) {
cliContext.Fatalf("Error %s. %s", err, cmd.UsageString())
}

cliContext.Spinner().StartWithMessage("Starting Neutron Node", "green")
cliContext.StartSpinnerIfNotVerbose("Starting Neutron Node", common.DiveLogs)

response, err := RunNeutron(cliContext)

Expand All @@ -52,6 +52,6 @@ func neutron(cmd *cobra.Command, args []string) {
cliContext.Fatal(err)
}
stopMessage := fmt.Sprintf("Neutron Node Started. Please find service details in current working directory(%s)\n", serviceFileName)
cliContext.Spinner().StopWithMessage(stopMessage)
cliContext.StopSpinnerIfNotVerbose(stopMessage, common.DiveLogs)

}
3 changes: 2 additions & 1 deletion test/functional/dive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ var _ = ginkgo.Describe("DIVE CLI App", func() {
err := cmd.Run()
fmt.Println(stdout.String())
gomega.Expect(err).NotTo(gomega.HaveOccurred())
cli := common.GetCli()
enclaveName := dive.GenerateRandomName()
cli := common.GetCli(enclaveName)
latestVersion := utility.GetLatestVersion(cli)
gomega.Expect(stdout.String()).To(gomega.ContainSubstring(latestVersion))
})
Expand Down

0 comments on commit 309f778

Please sign in to comment.