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

fix: check currentValue before updating newValue

parent eed98265
No related branches found
No related tags found
No related merge requests found
......@@ -32,18 +32,22 @@ 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'
);
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;
}
} else {
update.newValue = currentValue;
}
update.newMajor = versioning.getMajor(newVersion);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment