immediately return the patch incremented version if no changelog entries exist

This commit is contained in:
Fabio Berger
2018-11-21 17:27:27 +00:00
parent 3273117888
commit 71d15a68c1

View File

@@ -91,6 +91,7 @@ export const utils = {
const changelog = changelogUtils.getChangelogOrCreateIfMissing(packageName, packageLocation);
if (_.isEmpty(changelog)) {
nextVersionIfValid = semver.inc(currentVersion, 'patch');
return nextVersionIfValid as string;
}
const lastEntry = changelog[0];
if (semver.gt(currentVersion, lastEntry.version)) {