fix(mod_commit): Handle edge case for empty version details in changelog formatting
This commit is contained in:
		| @@ -1,5 +1,12 @@ | ||||
| # Changelog | ||||
|  | ||||
| ## 2024-06-23 - 1.9.120 - fix(mod_commit) | ||||
| Handle edge case for empty version details in changelog formatting | ||||
|  | ||||
| - Added check for the length of the recommendedNextVersionDetails array | ||||
| - Ensure no extra newline in changelog if there are no version details | ||||
|  | ||||
|  | ||||
| ## 2024-06-23 - 1.9.119 - fix(dependencies) | ||||
| Update @git.zone/tsdoc to v1.3.8 | ||||
|  | ||||
|   | ||||
| @@ -3,6 +3,6 @@ | ||||
|  */ | ||||
| export const commitinfo = { | ||||
|   name: '@git.zone/cli', | ||||
|   version: '1.9.119', | ||||
|   version: '1.9.120', | ||||
|   description: 'A CLI toolbelt to streamline local development cycles by using various gitzone utilities.' | ||||
| } | ||||
|   | ||||
| @@ -74,7 +74,11 @@ export const run = async (argvArg: any) => { | ||||
|   changelog = changelog.replaceAll('{{nextVersion}}', (await commitInfo.getNextPlannedVersion()).versionString); | ||||
|   changelog = changelog.replaceAll('{{nextVersionScope}}', `${await answerBucket.getAnswerFor('commitType')}(${await answerBucket.getAnswerFor('commitScope')})`); | ||||
|   changelog = changelog.replaceAll('{{nextVersionMessage}}', nextCommitObject.recommendedNextVersionMessage); | ||||
|   changelog = changelog.replaceAll('{{nextVersionDetails}}', '- ' + nextCommitObject.recommendedNextVersionDetails.join('\n- ')); | ||||
|   if (nextCommitObject.recommendedNextVersionDetails?.length > 0) { | ||||
|     changelog = changelog.replaceAll('{{nextVersionDetails}}', '- ' + nextCommitObject.recommendedNextVersionDetails.join('\n- ')); | ||||
|   } else { | ||||
|     changelog = changelog.replaceAll('\n\n{{nextVersionDetails}}', ''); | ||||
|   } | ||||
|  | ||||
|   await plugins.smartfile.memory.toFs(changelog, plugins.path.join(paths.cwd, `changelog.md`)); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user