Skip to content

Commit 5a4d0ff

Browse files
fix(#146): 🐛 issue with spinner (#147)
remove spinner Signed-off-by: Andy Augustin <dev@andreas-augustin.org>
1 parent f565196 commit 5a4d0ff

File tree

4 files changed

+29
-30
lines changed

4 files changed

+29
-30
lines changed

cmd/commit.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ var CommitCmd = &cobra.Command{
2323
Run: func(cmd *cobra.Command, args []string) {
2424
log.Debug("commit called")
2525
log.Debug(commitMsg)
26-
spin := ui.NewSpinner()
27-
spin.Run()
28-
defer func() { spin.Stop() }()
26+
//spin := ui.NewSpinner()
27+
//spin.Run()
28+
//defer func() { spin.Stop() }()
2929
existentHookFiles, err := pkg.HookFilesExistent()
3030
if err != nil {
3131
log.Fatalf("Error checking if hook files existent")
3232
}
3333
if len(existentHookFiles) > 0 {
3434
log.Infof("There are hook files existent for %s", existentHookFiles)
3535
log.Infof("Please use git commit command or remove the hooks with %s hooks rm", pkg.ProgramName)
36-
spin.Stop()
36+
//spin.Stop()
3737
return
3838
}
3939
config, err := pkg.GetCurrentConfig()
@@ -49,7 +49,7 @@ var CommitCmd = &cobra.Command{
4949
commitMsg,
5050
gitmojis.Gitmojis,
5151
)
52-
spin.Stop()
52+
//spin.Stop()
5353
commitValues := ui.CommitPrompt(config, gitmojis.Gitmojis, initialCommitValues, isBreaking)
5454
log.Debugf("complete title: %s", commitValues.Title)
5555
if isDryRun {

cmd/hooks.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ var HooksRemoveCmd = &cobra.Command{
1717
Long: `Delete the commit hooks which are created by the cli`,
1818
Run: func(cmd *cobra.Command, args []string) {
1919
log.Debug("hooks rm called")
20-
spin := ui.NewSpinner()
21-
spin.Run()
22-
defer func() { spin.Stop() }()
20+
//spin := ui.NewSpinner()
21+
//spin.Run()
22+
//defer func() { spin.Stop() }()
2323
err := pkg.RemoveAllHookFiles()
2424
if err != nil {
2525
log.Error(err)
@@ -36,11 +36,11 @@ var HooksInitCmd = &cobra.Command{
3636
Long: `Install the commit hooks into the local .git/hooks/ directory.`,
3737
Run: func(cmd *cobra.Command, args []string) {
3838
log.Debug("hooks init called")
39-
spin := ui.NewSpinner()
40-
spin.Run()
41-
defer func() {
42-
spin.Stop()
43-
}()
39+
//spin := ui.NewSpinner()
40+
//spin.Run()
41+
//defer func() {
42+
// spin.Stop()
43+
//}()
4444
err := pkg.CreateAllHookFiles()
4545
if err != nil {
4646
log.Error(err)
@@ -105,9 +105,9 @@ func init() {
105105
func hookCommit(commitMsgFile string, config pkg.Config) {
106106
log.Debug("hook --hooks called")
107107
log.Debug(commitMsg)
108-
spin := ui.NewSpinner()
109-
spin.Run()
110-
defer func() { spin.Stop() }()
108+
//spin := ui.NewSpinner()
109+
//spin.Run()
110+
//defer func() { spin.Stop() }()
111111
existentHookFiles, err := pkg.HookFilesExistent()
112112
if err != nil {
113113
log.Fatalf("Error checking if hook files existent")
@@ -132,7 +132,7 @@ func hookCommit(commitMsgFile string, config pkg.Config) {
132132
Desc: parsedMessages.Desc,
133133
Body: parsedMessages.Body,
134134
}
135-
spin.Stop()
135+
//spin.Stop()
136136
commitValues := ui.CommitPrompt(config, gitmojis.Gitmojis, initialCommitValues, isBreaking)
137137
commitMessage := fmt.Sprintf("%s\n\n%s", commitValues.Title, commitValues.Body)
138138
err = utils.WriteFile(commitMsgFile, []byte(commitMessage))

cmd/list.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ var ListCommitTypesCmd = &cobra.Command{
1414
Long: "The list from conventional commits is used",
1515
Run: func(cmd *cobra.Command, args []string) {
1616
log.Debug("list commit-types called")
17-
spin := ui.NewSpinner()
18-
spin.Run()
19-
defer func() { spin.Stop() }()
17+
//spin := ui.NewSpinner()
18+
//spin.Run()
19+
//defer func() { spin.Stop() }()
2020
defaultTypes := pkg.DefaultCommitTypes()
21-
spin.Stop()
21+
//spin.Stop()
2222
listSettings := ui.ListSettings{Title: "Commit types", IsShowStatusBar: true, IsFilteringEnabled: true}
2323
selectedDefaultType := ui.ListRun(listSettings, defaultTypes)
2424
log.Debugf("selected %s", selectedDefaultType)
@@ -31,14 +31,14 @@ var ListGitmojisCmd = &cobra.Command{
3131
Long: fmt.Sprintf(`The list is queried from the api %s.`, pkg.DefaultGitmojiApiUrl),
3232
Run: func(cmd *cobra.Command, args []string) {
3333
log.Debug("list gitmojis called")
34-
spin := ui.NewSpinner()
35-
spin.Run()
34+
//spin := ui.NewSpinner()
35+
//spin.Run()
3636
config, err := pkg.GetCurrentConfig()
3737
if err != nil {
3838
log.Fatalf("get current config issue, %s", err)
3939
}
4040
gitmojis := pkg.GetGitmojis(config)
41-
spin.Stop()
41+
//spin.Stop()
4242
listSettings := ui.ListSettings{Title: "Gitmojis", IsShowStatusBar: true, IsFilteringEnabled: true}
4343
selectedGitmoji := ui.ListRun(listSettings, gitmojis.Gitmojis)
4444
log.Debugf("selected %s", selectedGitmoji)

cmd/update.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package cmd
33
import (
44
"fmt"
55
"github.com/AndreasAugustin/go-gitmoji-cli/pkg"
6-
"github.com/AndreasAugustin/go-gitmoji-cli/pkg/ui"
76
log "github.com/sirupsen/logrus"
87
"github.com/spf13/cobra"
98
)
@@ -14,11 +13,11 @@ var UpdateGitmojisCmd = &cobra.Command{
1413
Long: fmt.Sprintf(`Update the gitmojis local cache from %s.`, pkg.DefaultGitmojiApiUrl),
1514
Run: func(cmd *cobra.Command, args []string) {
1615
log.Debug("update gitmojis called")
17-
spin := ui.NewSpinner()
18-
spin.Run()
19-
defer func() {
20-
spin.Stop()
21-
}()
16+
//spin := ui.NewSpinner()
17+
//spin.Run()
18+
//defer func() {
19+
// spin.Stop()
20+
//}()
2221
config, err := pkg.GetCurrentConfig()
2322
if err != nil {
2423
log.Fatalf("get current config issue, %s", err)

0 commit comments

Comments
 (0)