File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,9 @@ package cmd
2
2
3
3
import (
4
4
"boilerplate"
5
- "fmt "
5
+ "template "
6
6
7
+ "github.com/commit-message-formatter/pkg/git"
7
8
"github.com/spf13/cobra"
8
9
)
9
10
@@ -14,7 +15,20 @@ var Root = &cobra.Command{
14
15
Long : "Generate custom commit message for your repo and standarize your commits log" ,
15
16
PreRun : func (cmd * cobra.Command , args []string ) {},
16
17
Run : func (cmd * cobra.Command , args []string ) {
17
- fmt .Println ("RUN..." )
18
+ go git .CheckTree ()
19
+ message := template .Run ()
20
+ git .Commit (message )
21
+ },
22
+ }
23
+
24
+ var amend = & cobra.Command {
25
+ Use : "amend" ,
26
+ Short : "Amend commit message" ,
27
+ Long : "Amend last commit message" ,
28
+ PreRun : func (cmd * cobra.Command , args []string ) {},
29
+ Run : func (cmd * cobra.Command , args []string ) {
30
+ message := template .Run ()
31
+ git .Amend (message )
18
32
},
19
33
}
20
34
@@ -30,4 +44,5 @@ var boilerplateCMD = &cobra.Command{
30
44
31
45
func init () {
32
46
Root .AddCommand (boilerplateCMD )
47
+ Root .AddCommand (amend )
33
48
}
You can’t perform that action at this time.
0 commit comments