Skip to content
Snippets Groups Projects
Commit bb64598d authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix: check currentValue before generating newValue

parent f6454ba1
No related branches found
No related tags found
No related merge requests found
......@@ -32,19 +32,21 @@ export function generateUpdate(
}
}
const { currentValue } = config;
try {
update.newValue = versioning.getNewValue({
currentValue,
rangeStrategy,
currentVersion,
newVersion,
});
} catch (err) /* istanbul ignore next */ {
logger.warn(
{ err, currentValue, rangeStrategy, currentVersion, newVersion },
'getNewValue error'
);
update.newValue = currentValue;
if (currentValue) {
try {
update.newValue = versioning.getNewValue({
currentValue,
rangeStrategy,
currentVersion,
newVersion,
});
} catch (err) /* istanbul ignore next */ {
logger.warn(
{ err, currentValue, rangeStrategy, currentVersion, newVersion },
'getNewValue error'
);
update.newValue = currentValue;
}
}
update.newMajor = versioning.getMajor(newVersion);
update.newMinor = versioning.getMinor(newVersion);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment