Skip to content

Commit d626569

Browse files
author
R0n0066
committed
update(utils): Add message for feedback on commit progress
1 parent 5ea6b6d commit d626569

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmd/utils.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ import (
2828
"time"
2929

3030
"github.com/fatih/color"
31+
. "github.com/logrusorgru/aurora"
3132
"github.com/manifoldco/promptui"
3233
"github.com/spf13/viper"
33-
gitconfig "github.com/tcnksm/go-gitconfig"
3434
git "gopkg.in/src-d/go-git.v4"
3535
"gopkg.in/src-d/go-git.v4/plumbing/object"
36+
gitconfig "walmart.com/cfm/src/github.com/tcnksm/go-gitconfig"
3637
)
3738

3839
func checkErr(err error) {
@@ -114,6 +115,7 @@ func commit(message string) (err error) {
114115

115116
w, err := r.Worktree()
116117
checkErr(err)
118+
fmt.Println(Gray("Checking working tree..."))
117119

118120
s, err := w.Status()
119121
checkErr(err)
@@ -128,6 +130,7 @@ func commit(message string) (err error) {
128130
if hasStagingFiles {
129131
username, err := gitconfig.Username()
130132
email, err := gitconfig.Email()
133+
fmt.Println(Gray("Preparing commit..."))
131134

132135
_, err = w.Commit(message, &git.CommitOptions{
133136
Author: &object.Signature{
@@ -137,6 +140,8 @@ func commit(message string) (err error) {
137140
},
138141
})
139142
checkErr(err)
143+
fmt.Println(Green("Done!"))
144+
fmt.Println(Magenta("Happy coding!"))
140145
} else {
141146
checkErr(errors.New("no changes added to commit"))
142147
}

0 commit comments

Comments
 (0)