checkPlugin: Use `updateDeps` to manage `engine`
parent
f0ab112c2d
commit
b7dce95802
|
@ -188,6 +188,10 @@ fs.readdir(pluginPath, (err, rootFiles) => {
|
|||
'ep_etherpad-lite': {ver: '>=1.8.6', overwrite: false},
|
||||
});
|
||||
|
||||
updateDeps(parsedPackageJSON, 'engines', {
|
||||
node: '>=12.13.0',
|
||||
});
|
||||
|
||||
if (packageJSON.toLowerCase().indexOf('eslintconfig') === -1) {
|
||||
console.warn('No esLintConfig in package.json');
|
||||
if (autoFix) {
|
||||
|
@ -211,17 +215,6 @@ fs.readdir(pluginPath, (err, rootFiles) => {
|
|||
writePackageJson(parsedPackageJSON);
|
||||
}
|
||||
}
|
||||
|
||||
if ((packageJSON.toLowerCase().indexOf('engines') === -1) || !parsedPackageJSON.engines.node) {
|
||||
console.warn('No engines or node engine in package.json');
|
||||
if (autoFix) {
|
||||
const engines = {
|
||||
node: '>=12.13.0',
|
||||
};
|
||||
parsedPackageJSON.engines = engines;
|
||||
writePackageJson(parsedPackageJSON);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (files.indexOf('package-lock.json') === -1) {
|
||||
|
|
Loading…
Reference in New Issue