Skip to content

Commit

Permalink
fix: prompt testing
Browse files Browse the repository at this point in the history
  • Loading branch information
seriouspoop committed Aug 28, 2024
1 parent 97b20f2 commit 247a64f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions svc/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ func (s *Svc) CreateBranchAndSwitch(branch model.Branch) error {
}

func generateCommitMsg() (string, error) {
template := &promptui.SelectTemplates{
selecttTemplate := &promptui.SelectTemplates{
Active: "\U0001F892 {{ . | green }}",
}
prompt := promptui.Select{
Label: "Select commit type",
Items: []string{"fix", "feature", "chore", "refactor", "ci"},
Templates: template,
Templates: selecttTemplate,
}
_, commitType, err := prompt.Run()
if err != nil {
Expand All @@ -131,8 +131,14 @@ func generateCommitMsg() (string, error) {
commitType = shortner[commitType]
}

promptTemplate := &promptui.PromptTemplates{
Valid: "{{ . }}",
// Success: "{{ }}",
}

message := promptui.Prompt{
Label: "Commit Message",
Label: "Commit Message",
Templates: promptTemplate,
}
msg, err := message.Run()
if err != nil {
Expand Down

0 comments on commit 247a64f

Please sign in to comment.