Skip to content
This repository was archived by the owner on Mar 24, 2023. It is now read-only.

Commit 02d2527

Browse files
author
dada513
committed
add automatic commit message
1 parent 46f7f77 commit 02d2527

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

issue.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"context"
5+
"fmt"
56
"log"
67
"regexp"
78
"strings"
@@ -21,10 +22,13 @@ func IssueCommand() {
2122
HandleError(err4)
2223

2324
var sites []string
25+
var issueids []int
26+
var commitmsg string = "Closes"
27+
2428
for _, issue := range issues {
2529
var title string = *issue.Title
2630
var prefix1 string = "New site to add: "
27-
31+
issueids = append(issueids, issue.GetNumber())
2832
hasPrefix := strings.HasPrefix(title, prefix1)
2933

3034
if hasPrefix {
@@ -45,9 +49,15 @@ func IssueCommand() {
4549
for _, siteText := range sites {
4650
t = append(t, IllegalSite{Domain: siteText, Notes: "/", Path: "/", Reason: "Illegal redistribution"})
4751
}
52+
53+
for _, id := range issueids {
54+
commitmsg = commitmsg + " #" + fmt.Sprint(id)
55+
}
56+
4857
SaveList(f, t)
4958
warnMsg := "The parsing is very fragile; please review the changes via Git and change the titles"
5059
LogSeparator(len(warnMsg) - 1)
5160
log.Println(warnMsg)
5261
LogSeparator(len(warnMsg) - 1)
62+
log.Println("Generated commit message", commitmsg)
5363
}

0 commit comments

Comments
 (0)