@@ -4,20 +4,17 @@ import fs from "fs"
44import { execSync } from "child_process"
55
66function main ( ) {
7- // Check command line flags
8- const updateChangelogOnly = process . argv . includes ( "--update-changelog-only" )
9- const getChangelogContent = process . argv . includes ( "--get-changelog-content" )
7+ // Check if we should only update changelog (no tag creation)
8+ const updateChangelogOnly = process . argv . includes ( "--update-changelog" )
109
1110 // Read package.json to get current version
1211 const pkg = JSON . parse ( fs . readFileSync ( "package.json" , "utf8" ) )
1312 const version = pkg . version
1413
1514 if ( updateChangelogOnly ) {
1615 console . log ( `Updating changelog for version ${ version } ...` )
17- } else if ( getChangelogContent ) {
18- // Just get the changelog content for this version and exit
1916 } else {
20- console . log ( `Updating changelog and creating tag for version ${ version } ...` )
17+ console . log ( `Creating tag for version ${ version } ...` )
2118 }
2219
2320 // Read changelog
@@ -32,7 +29,7 @@ function main() {
3229 // Check if version already exists in changelog
3330 if ( changelog . includes ( newVersionHeader ) || changelog . includes ( versionHeader ) ) {
3431 console . log ( `Version ${ version } already exists in changelog. Skipping update.` )
35- } else if ( changelog . includes ( unreleasedHeader ) && ! getChangelogContent ) {
32+ } else if ( changelog . includes ( unreleasedHeader ) ) {
3633 console . log ( "Updating [Unreleased] section to current version..." )
3734 changelog = changelog . replace ( unreleasedHeader , newVersionHeader )
3835
@@ -46,13 +43,10 @@ function main() {
4643
4744 // Write updated changelog back to file
4845 fs . writeFileSync ( "CHANGELOG.md" , changelog , "utf8" )
49-
50- // Stage the changelog file for commit
51- execSync ( "git add CHANGELOG.md" , { stdio : "inherit" } )
52- console . log ( "✅ Updated CHANGELOG.md and staged for commit" )
46+ console . log ( "✅ Updated CHANGELOG.md" )
5347 }
5448
55- // If only updating changelog, exit here
49+ // If only updating changelog, exit here (don't create tag)
5650 if ( updateChangelogOnly ) {
5751 return
5852 }
@@ -72,12 +66,6 @@ function main() {
7266 // Extract the content for this version
7367 const content = changelog . substring ( startIdx , nextVersionIdx === - 1 ? undefined : nextVersionIdx ) . trim ( )
7468
75- // If only getting changelog content, just output it and exit
76- if ( getChangelogContent ) {
77- console . log ( content )
78- return
79- }
80-
8169 console . log ( "Changelog content:" )
8270 console . log ( content )
8371 console . log ( )
0 commit comments