File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import fs from 'node:fs' ;
2+ import os from 'node:os' ;
3+ import path from 'node:path' ;
14import chalk from 'chalk' ;
25import { execa } from 'execa' ;
36import open from 'open' ;
@@ -31,8 +34,20 @@ async function bumpVersionAndTag(opts: ReleaseOptions) {
3134
3235 await run ( 'git add -A' , { dryRun } ) ;
3336
34- const tags = pkgs . map ( s => getGitTagVersion ( s . name , s . version , opts ) ) ;
35- await run ( `git commit -m "chore: release ${ tags . join ( ', ' ) } "` , { dryRun } ) ;
37+ // git commit message
38+ const tags = pkgs . map ( s => getGitTagVersion ( s . name , s . newVersion , opts ) ) ;
39+ let msg = `chore: release ${ tags . length > 1 ? `${ tags . length } packages` : `${ tags [ 0 ] } ` } ` ;
40+ if ( pkgs . length > 1 ) {
41+ msg += `\n\n` ;
42+ msg += pkgs . map ( s => `${ s . name } : ${ s . version } => ${ s . newVersion } ` ) . join ( '\n' ) ;
43+ }
44+
45+ const msgFile = path . join ( os . tmpdir ( ) , `tomjs-release-${ Date . now ( ) } .txt` ) ;
46+ fs . writeFileSync ( msgFile , msg ) ;
47+
48+ await run ( [ `git commit --file "${ msgFile } "` ] , { dryRun } ) ;
49+
50+ fs . rmSync ( msgFile ) ;
3651
3752 for ( const tag of tags ) {
3853 await run ( `git tag ${ tag } ` , { dryRun } ) ;
You can’t perform that action at this time.
0 commit comments