File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 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) {
2424 }
2525}
2626
27- // 获取从最近的标签开始的所有最新记录
28- async function getCommitsSinceLatestTag ( ) {
27+ // 从指定标签获取所有最新记录
28+ async function getCommitsSinceTag ( tagId ) {
2929 const tags = promisify ( git . tags . bind ( git ) )
3030 const log = promisify ( git . log . bind ( git ) )
31- const latestTag = ( await tags ( ) ) . latest
3231
33- if ( ! latestTag ) {
32+ if ( ! tagId ) {
33+ tagId = ( await tags ( ) ) . latest
34+ }
35+
36+ if ( ! tagId ) {
3437 console . error ( 'No tags found.' )
3538 return [ ]
3639 }
3740
3841 const logOptions = {
39- from : latestTag ,
42+ from : tagId ,
4043 }
4144
4245 try {
@@ -81,7 +84,8 @@ async function generateLogs(name, logs) {
8184 try {
8285 // const commits = await getCommitsSince('d9acb96')
8386 const commitId = args . commit || args . C
84- const getCommitLogs = ( ) => ( commitId ? getCommitsSince ( commitId ) : getCommitsSinceLatestTag ( ) )
87+ const getCommitLogs = ( ) =>
88+ commitId ? getCommitsSince ( commitId ) : getCommitsSinceTag ( args . tag )
8589 const commits = await getCommitLogs ( )
8690 const formattedCommits = formatCommits ( commits , ( commit ) => {
8791 return moduleRegex . test ( commit . message )
You can’t perform that action at this time.
0 commit comments