Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ronenlu committed Oct 19, 2023
1 parent 12f8124 commit d8ffdbb
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,34 @@ func (i *InitActionCmd) setParams(dirs []string) error {
if _, i.Driver, err = prompt.Run(); err != nil {
return err
}
}
switch {
case i.DirPath == "" && len(dirs) == 0:
prompt := promptui.Prompt{
Label: "Enter the path of the migration directory in your repository",
Stdin: i.stdin,
}
if i.DirPath, err = prompt.Run(); err != nil {
return err
}
case i.DirPath == "" && len(dirs) > 0:
opts := append(dirs, "provide another path")
prompt := promptui.Select{
Label: "Choose migration directory",
Items: opts,
Stdin: i.stdin,
switch {
case len(dirs) == 0:
prompt := promptui.Prompt{
Label: "Enter the path of the migration directory in your repository",
Stdin: i.stdin,
}
if i.DirPath, err = prompt.Run(); err != nil {
return err
}
case len(dirs) > 0:
opts := append(dirs, "provide another path")
prompt := promptui.Select{
Label: "Choose migration directory",
Items: opts,
Stdin: i.stdin,
}
if _, i.DirPath, err = prompt.Run(); err != nil {
return err
}
}
if _, i.DirPath, err = prompt.Run(); err != nil {
return err
}
}
if i.DirPath == "provide another path" {
prompt := promptui.Prompt{
Label: "Enter the path of the migration directory in your repository",
Stdin: i.stdin,
}
if i.DirPath, err = prompt.Run(); err != nil {
return err
if i.DirPath == "provide another path" {
prompt := promptui.Prompt{
Label: "Enter the path of the migration directory in your repository",
Stdin: i.stdin,
}
if i.DirPath, err = prompt.Run(); err != nil {
return err
}
}
}
if i.Token == "" {
Expand Down

0 comments on commit d8ffdbb

Please sign in to comment.