File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -24,19 +24,22 @@ async function getCommitsSince(commitId) {
24
24
}
25
25
}
26
26
27
- // 获取从最近的标签开始的所有最新记录
28
- async function getCommitsSinceLatestTag ( ) {
27
+ // 从指定标签获取所有最新记录
28
+ async function getCommitsSinceTag ( tagId ) {
29
29
const tags = promisify ( git . tags . bind ( git ) )
30
30
const log = promisify ( git . log . bind ( git ) )
31
- const latestTag = ( await tags ( ) ) . latest
32
31
33
- if ( ! latestTag ) {
32
+ if ( ! tagId ) {
33
+ tagId = ( await tags ( ) ) . latest
34
+ }
35
+
36
+ if ( ! tagId ) {
34
37
console . error ( 'No tags found.' )
35
38
return [ ]
36
39
}
37
40
38
41
const logOptions = {
39
- from : latestTag ,
42
+ from : tagId ,
40
43
}
41
44
42
45
try {
@@ -81,7 +84,8 @@ async function generateLogs(name, logs) {
81
84
try {
82
85
// const commits = await getCommitsSince('d9acb96')
83
86
const commitId = args . commit || args . C
84
- const getCommitLogs = ( ) => ( commitId ? getCommitsSince ( commitId ) : getCommitsSinceLatestTag ( ) )
87
+ const getCommitLogs = ( ) =>
88
+ commitId ? getCommitsSince ( commitId ) : getCommitsSinceTag ( args . tag )
85
89
const commits = await getCommitLogs ( )
86
90
const formattedCommits = formatCommits ( commits , ( commit ) => {
87
91
return moduleRegex . test ( commit . message )
You can’t perform that action at this time.
0 commit comments