File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4141 "postbuild" : " echo '{\" type\" : \" commonjs\" }' > lib/cjs/package.json" ,
4242 "prepare" : " npm run build" ,
4343 "preversion" : " npm run test:local" ,
44- "version" : " sed -i'' \" s/VERSION = .*/VERSION = ' $npm_package_version' /\" src/amqp-base-client.ts && node scripts/release-tag.js && git add src/amqp-base-client.ts CHANGELOG.md" ,
44+ "version" : " sed -i'' \" s/VERSION = .*/VERSION = \\\" $npm_package_version\\\" /\" src/amqp-base-client.ts && npm run format && node scripts/release-tag.js && git add src/amqp-base-client.ts CHANGELOG.md" ,
4545 "postversion" : " git push && git push --tags" ,
4646 "release" : " npm version patch" ,
4747 "release:minor" : " npm version minor" ,
Original file line number Diff line number Diff line change @@ -19,7 +19,10 @@ function main() {
1919 const today = new Date ( ) . toISOString ( ) . split ( "T" ) [ 0 ] // YYYY-MM-DD format
2020 const newVersionHeader = `## [${ version } ] - ${ today } `
2121
22- if ( changelog . includes ( unreleasedHeader ) ) {
22+ // Check if version already exists in changelog
23+ if ( changelog . includes ( newVersionHeader ) || changelog . includes ( versionHeader ) ) {
24+ console . log ( `Version ${ version } already exists in changelog. Skipping update.` )
25+ } else if ( changelog . includes ( unreleasedHeader ) ) {
2326 console . log ( "Updating [Unreleased] section to current version..." )
2427 changelog = changelog . replace ( unreleasedHeader , newVersionHeader )
2528
You can’t perform that action at this time.
0 commit comments