* Stages and commits changes, or prints the commit message in preview mode
()
| 334 | * Stages and commits changes, or prints the commit message in preview mode |
| 335 | */ |
| 336 | function commitChanges() { |
| 337 | let commitMessage = generateCommitMessage(releases); |
| 338 | |
| 339 | if (preview) { |
| 340 | console.log(` • Would commit with message: ${commitMessage}`); |
| 341 | console.log(); |
| 342 | } else if (skipCommit) { |
| 343 | console.log("═".repeat(80)); |
| 344 | console.log(colorize("VERSION UPDATED", colors.lightGreen)); |
| 345 | console.log("═".repeat(80)); |
| 346 | console.log(); |
| 347 | console.log("Files updated. Review the changes, then manually commit:"); |
| 348 | console.log(); |
| 349 | console.log(` git add .`); |
| 350 | console.log(` git commit -m "${commitMessage}"`); |
| 351 | console.log(); |
| 352 | } else { |
| 353 | // Stage all changes |
| 354 | console.log("Staging changes..."); |
| 355 | logAndExec("git add ."); |
| 356 | console.log(); |
| 357 | |
| 358 | // Create commit |
| 359 | console.log("Creating commit..."); |
| 360 | logAndExec(`git commit -m "${commitMessage}"`); |
| 361 | console.log(); |
| 362 | |
| 363 | // Success message (skip in CI since the workflow handles the rest) |
| 364 | if (!process.env.CI) { |
| 365 | console.log("═".repeat(80)); |
| 366 | console.log("✅ RELEASE PREPARED"); |
| 367 | console.log("═".repeat(80)); |
| 368 | console.log(); |
| 369 | console.log("Release commit has been created locally."); |
| 370 | console.log(); |
| 371 | console.log( |
| 372 | "To publish, push and the publish workflow will handle the rest:", |
| 373 | ); |
| 374 | console.log(); |
| 375 | console.log(" git push"); |
| 376 | console.log(); |
| 377 | } |
| 378 | } |
| 379 | } |
no test coverage detected
searching dependent graphs…