mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 07:26:26 +00:00
faa4cc6171
Updates travis config and logic to use same variables as for other managers. This fixes the onboarding PR. Fixes #1551
20 lines
605 B
JavaScript
20 lines
605 B
JavaScript
const detectIndent = require('detect-indent');
|
|
|
|
module.exports = {
|
|
setNewValue,
|
|
};
|
|
|
|
function setNewValue(currentFileContent, upgrade) {
|
|
try {
|
|
logger.debug(`node.setNewValue: ${upgrade.newVersion}`);
|
|
const indent = detectIndent(currentFileContent).indent || ' ';
|
|
let newString = `\nnode_js:\n`;
|
|
upgrade.newVersion.forEach(version => {
|
|
newString += `${indent}- '${version}'\n`;
|
|
});
|
|
return currentFileContent.replace(/\nnode_js:(\n\s+[^\n]+)+\n/, newString);
|
|
} catch (err) {
|
|
logger.info({ err }, 'Error setting new .travis.yml node versions');
|
|
return null;
|
|
}
|
|
}
|