Skip to content

Commit c5aacc6

Browse files
Merge pull request #2 from walmartdigital/display-progress
Display progress
2 parents 25511a1 + 1b6e0c4 commit c5aacc6

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

Gopkg.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/utils.go

Lines changed: 8 additions & 2 deletions
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("Changes added, Preparing commit..."))
131134

132135
_, err = w.Commit(message, &git.CommitOptions{
133136
Author: &object.Signature{
@@ -137,8 +140,11 @@ func commit(message string) (err error) {
137140
},
138141
})
139142
checkErr(err)
143+
lastCommit := "Last commit: " + message
144+
fmt.Println(Gray(lastCommit))
145+
fmt.Println(Green("Done"))
140146
} else {
141-
checkErr(errors.New("no changes added to commit"))
147+
checkErr(errors.New("No changes added to commit"))
142148
}
143149

144150
return

0 commit comments

Comments
 (0)