Skip to content

Commit

Permalink
chore: create roller.toml during init
Browse files Browse the repository at this point in the history
  • Loading branch information
artemijspavlovs committed Aug 12, 2024
1 parent 130eb89 commit 167cdef
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cmd/rollapp/init/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,20 @@ func runInit(cmd *cobra.Command, env string, raID string) error {
"da": string(consts.Celestia),
}

_, err = os.Stat(rollerConfigFilePath)
if err != nil {
if errors.Is(err, fs.ErrNotExist) {
pterm.Info.Println("roller.toml not found, creating")
_, err := os.Create(rollerConfigFilePath)
if err != nil {
pterm.Error.Printf(
"failed to create %s: %v", rollerConfigFilePath, err,
)
return err
}
}
}

for key, value := range rollerTomlData {
err = globalutils.UpdateFieldInToml(
rollerConfigFilePath,
Expand Down

0 comments on commit 167cdef

Please sign in to comment.