This commit is contained in:
Timo Hocker 2020-05-13 21:12:29 +02:00
parent 190f20c7b9
commit 08ec8d9182

View File

@ -26,12 +26,12 @@ if (typeof pkg.repository === 'undefined') {
} }
function major (version) { function major (version) {
return version.replace (/\.[0-9]+$/ui, ''); return version.replace (/\.[0-9x]+$/ui, '');
} }
if (fs.existsSync ('README.md')) { if (fs.existsSync ('README.md')) {
const readme = fs.readFileSync ('README.md', 'utf-8'); const readme = fs.readFileSync ('README.md', 'utf-8');
const version = (/version: ([0-9.]+)/ui).exec (readme); const version = (/version: ([0-9x.]+)/ui).exec (readme);
if ( if (
version === null version === null
|| major (version[1]) !== major (pkg.version) || major (version[1]) !== major (pkg.version)