Skip to content

Commit

Permalink
Implemented channel creation on roller relayer start
Browse files Browse the repository at this point in the history
  • Loading branch information
ItayLevyOfficial committed Jun 15, 2023
1 parent 41bac0b commit 2ce70ee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
5 changes: 2 additions & 3 deletions cmd/relayer/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ func Start() *cobra.Command {
utils.PrettifyErrorIfExists(err)
fmt.Println(rollappConfig)
createChannelCmd := getCreateChannelCmd(rollappConfig)
// print the createChannelCmd args seperated by spaces
fmt.Println("createChannelCmd args: ", createChannelCmd.Args)
utils.PrettifyErrorIfExists(utils.ExecBashCommandWithoutOutput(createChannelCmd))
err = utils.ExecBashCommandWithOSOutput(createChannelCmd)
utils.PrettifyErrorIfExists(err)
},
}
utils.AddGlobalFlags(registerCmd)
Expand Down
11 changes: 6 additions & 5 deletions cmd/utils/error_handling.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ func RunBashCmdAsync(cmd *exec.Cmd, printOutput func(), parseError func(errMsg s
}
}

func ExecBashCommandWithoutOutput(cmd *exec.Cmd) error {
_, err := ExecBashCommand(cmd)
return err
}

func ExecBashCommand(cmd *exec.Cmd) (bytes.Buffer, error) {
var stderr bytes.Buffer
var stdout bytes.Buffer
Expand All @@ -54,3 +49,9 @@ func ExecBashCommand(cmd *exec.Cmd) (bytes.Buffer, error) {
}
return stdout, nil
}

func ExecBashCommandWithOSOutput(cmd *exec.Cmd) error {
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return cmd.Run()
}

0 comments on commit 2ce70ee

Please sign in to comment.