mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 07:26:26 +00:00
d8cb261ecb
Renames currentVersion to currentValue, newVersion to newValue, newVersionMajor to newMajor, and newVersionMinor to newMinor.
16 lines
447 B
JavaScript
16 lines
447 B
JavaScript
module.exports = {
|
|
updateDependency,
|
|
};
|
|
|
|
function updateDependency(fileContent, upgrade) {
|
|
const { depName, currentValue, newValue } = upgrade;
|
|
logger.debug(`meteor.updateDependency(): ${depName} = ${newValue}`);
|
|
const regexReplace = new RegExp(
|
|
`('|")(${depName})('|"):(\\s+)('|")${currentValue}('|")`
|
|
);
|
|
const newFileContent = fileContent.replace(
|
|
regexReplace,
|
|
`$1$2$3:$4$5${newValue}$6`
|
|
);
|
|
return newFileContent;
|
|
}
|