Skip to content

Commit 99f7282

Browse files
fix(#131): 🐛 issue with hook when amending or rebasing (#136)
* chore(deps): bump github.com/charmbracelet/bubbletea (#132) Bumps [github.com/charmbracelet/bubbletea](https://github.com/charmbracelet/bubbletea) from 0.26.1 to 0.26.2. - [Release notes](https://github.com/charmbracelet/bubbletea/releases) - [Commits](charmbracelet/bubbletea@v0.26.1...v0.26.2) --- updated-dependencies: - dependency-name: github.com/charmbracelet/bubbletea dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix(#131): 🐛 issue with hook when amend or rebase --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent e6276c5 commit 99f7282

File tree

12 files changed

+27
-41
lines changed

12 files changed

+27
-41
lines changed

cmd/commit.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ var CommitCmd = &cobra.Command{
2020
Use: "commit",
2121
Short: "Interactively commit using prompts",
2222
Long: `Do the commit. This command is disabled when you are using commit hooks`,
23-
PreRun: func(cmd *cobra.Command, args []string) {
24-
programNameFigure()
25-
},
2623
Run: func(cmd *cobra.Command, args []string) {
2724
log.Debug("commit called")
2825
log.Debug(commitMsg)

cmd/common.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ package cmd
22

33
import (
44
"fmt"
5-
"github.com/AndreasAugustin/go-gitmoji-cli/pkg"
6-
"github.com/common-nighthawk/go-figure"
75
log "github.com/sirupsen/logrus"
86
"github.com/spf13/cobra"
97
"github.com/spf13/viper"
@@ -26,9 +24,3 @@ func bindAndAddBoolFlag(cmd *cobra.Command, viperKey string, flagName string, us
2624
log.Fatalf("issue with binding flags %s", err)
2725
}
2826
}
29-
30-
func programNameFigure() {
31-
programNameFigure := figure.NewColorFigure(pkg.ProgramName, "cybermedium", "purple", true)
32-
33-
programNameFigure.Print()
34-
}

cmd/config.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ var ConfigCmd = &cobra.Command{
1616
Long: `Configure the cli.
1717
There are default options available which are overwritten
1818
by the local configuration file or a global configuration file within your OS config folder (use the info command to get the information where it is stored)`,
19-
PreRun: func(cmd *cobra.Command, args []string) {
20-
programNameFigure()
21-
},
2219
Run: func(cmd *cobra.Command, args []string) {
2320
log.Debug("config called")
2421
config, err := pkg.GetCurrentConfig()

cmd/hooks.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ var HooksCmd = &cobra.Command{
5555
Use: "hooks",
5656
Short: fmt.Sprintf("Manage %s commit hooks", pkg.ProgramName),
5757
Long: `Manage git hooks for the cli`,
58-
PreRun: func(cmd *cobra.Command, args []string) {
59-
programNameFigure()
60-
},
6158
Run: func(cmd *cobra.Command, args []string) {
6259
config, err := pkg.GetCurrentConfig()
6360
if err != nil {

cmd/info.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ var InfoCmd = &cobra.Command{
1111
Use: "info",
1212
Short: "Get some relevant information",
1313
Long: `Get some information like config or cache directory on your OS where the cli is writing configuration or cache.`,
14-
PreRun: func(cmd *cobra.Command, args []string) {
15-
programNameFigure()
16-
},
1714
Run: func(cmd *cobra.Command, args []string) {
1815
config, err := pkg.GetCurrentConfig()
1916
if err != nil {

cmd/list.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ var ListCommitTypesCmd = &cobra.Command{
1212
Use: "commit-types",
1313
Short: "List all the available commit types",
1414
Long: "The list from conventional commits is used",
15-
PreRun: func(cmd *cobra.Command, args []string) {
16-
programNameFigure()
17-
},
1815
Run: func(cmd *cobra.Command, args []string) {
1916
log.Debug("list commit-types called")
2017
spin := ui.NewSpinner()
@@ -32,9 +29,6 @@ var ListGitmojisCmd = &cobra.Command{
3229
Use: "gitmojis",
3330
Short: "List all the available gitmojis",
3431
Long: fmt.Sprintf(`The list is queried from the api %s.`, pkg.DefaultGitmojiApiUrl),
35-
PreRun: func(cmd *cobra.Command, args []string) {
36-
programNameFigure()
37-
},
3832
Run: func(cmd *cobra.Command, args []string) {
3933
log.Debug("list gitmojis called")
4034
spin := ui.NewSpinner()

cmd/root.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ import (
1111
var debug bool
1212

1313
var RootCmd = &cobra.Command{
14-
Use: pkg.ProgramName,
15-
PreRun: func(cmd *cobra.Command, args []string) {
16-
programNameFigure()
17-
},
14+
Use: pkg.ProgramName,
1815
Short: "Cli to help managing gitmoji commit messages",
1916
Long: fmt.Sprintf(`See %s for more information about Gitmoji`, pkg.DefaultGitmojiUrl),
2017
}

cmd/update.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ import (
99
)
1010

1111
var UpdateGitmojisCmd = &cobra.Command{
12-
Use: "gitmojis",
13-
PreRun: func(cmd *cobra.Command, args []string) {
14-
programNameFigure()
15-
},
12+
Use: "gitmojis",
1613
Short: fmt.Sprintf("update the local gitmoji database %s", pkg.ProgramName),
1714
Long: fmt.Sprintf(`Update the gitmojis local cache from %s.`, pkg.DefaultGitmojiApiUrl),
1815
Run: func(cmd *cobra.Command, args []string) {
@@ -33,10 +30,7 @@ var UpdateGitmojisCmd = &cobra.Command{
3330
}
3431

3532
var updateCmd = &cobra.Command{
36-
Use: "update",
37-
PreRun: func(cmd *cobra.Command, args []string) {
38-
programNameFigure()
39-
},
33+
Use: "update",
4034
Short: fmt.Sprintf("Manage %s updates", pkg.ProgramName),
4135
Long: `Update command for the cli.`,
4236
}

docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.7'
2-
31
services:
42
dev:
53
build:

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ require (
77
github.com/charmbracelet/bubbletea v0.26.2
88
github.com/charmbracelet/glamour v0.7.0
99
github.com/charmbracelet/lipgloss v0.10.0
10-
github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be
1110
github.com/mattn/go-isatty v0.0.20
1211
github.com/muesli/mango-cobra v1.2.0
1312
github.com/muesli/roff v0.1.0

0 commit comments

Comments
 (0)