File tree Expand file tree Collapse file tree 1 file changed +21
-9
lines changed
Expand file tree Collapse file tree 1 file changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -40,22 +40,34 @@ export class ReleasesMdFile {
4040 return this . #fileText;
4141 }
4242
43- updateWithGitLog (
44- { gitLog, version, date } : {
45- gitLog : GitLogOutput ;
46- version : string ;
47- date ?: Date ;
48- } ,
49- ) {
43+ updateWithGitLog ( {
44+ gitLog,
45+ version,
46+ date,
47+ bodyPreText,
48+ } : {
49+ gitLog : GitLogOutput ;
50+ version : string ;
51+ date ?: Date ;
52+ /** Text to insert after the title and before the git log. */
53+ bodyPreText ?: string ;
54+ } ) {
5055 const insertText = getInsertText ( ) ;
5156 this . #updateText( this . #fileText. replace ( / ^ # # # / m, insertText + "\n\n### " ) ) ;
5257
5358 function getInsertText ( ) {
5459 const formattedGitLog = gitLog . formatForReleaseMarkdown ( ) ;
5560 const formattedDate = getFormattedDate ( date ?? new Date ( ) ) ;
5661
57- return `### ${ version } / ${ formattedDate } \n\n` +
58- `${ formattedGitLog } ` ;
62+ let text = `### ${ version } / ${ formattedDate } \n\n` ;
63+
64+ if ( bodyPreText != null && bodyPreText . length > 0 ) {
65+ text += `${ bodyPreText } \n\n` ;
66+ }
67+
68+ text += formattedGitLog ;
69+
70+ return text ;
5971
6072 function getFormattedDate ( date : Date ) {
6173 const formattedMonth = padTwoDigit ( date . getMonth ( ) + 1 ) ;
You can’t perform that action at this time.
0 commit comments