diff --git a/asset_jenkins.js b/asset_jenkins.js index f74bfe5..b0b7413 100644 --- a/asset_jenkins.js +++ b/asset_jenkins.js @@ -35,13 +35,17 @@ if (typeof pkg.repository === 'undefined') { process.exit (1); } +function major (version) { + return version.replace (/\\.[0-9]+$/ui, ''); +} + if (fs.existsSync ('README.md')) { const readme = fs.readFileSync ('README.md', 'utf-8'); // eslint-disable-next-line prefer-named-capture-group const version = (/version: ([0-9.]+)/ui).exec (readme); if ( version === null - || version[1] !== pkg.version + || major (version[1]) !== major (pkg.version) ) { console.log ('readme version does not match package version'); process.exit (1); diff --git a/jenkins.js b/jenkins.js index d0f8ea8..a9ca3a3 100644 --- a/jenkins.js +++ b/jenkins.js @@ -26,13 +26,17 @@ if (typeof pkg.repository === 'undefined') { process.exit (1); } +function major (version) { + return version.replace (/\.[0-9]+$/ui, ''); +} + if (fs.existsSync ('README.md')) { const readme = fs.readFileSync ('README.md', 'utf-8'); // eslint-disable-next-line prefer-named-capture-group const version = (/version: ([0-9.]+)/ui).exec (readme); if ( version === null - || version[1] !== pkg.version + || major (version[1]) !== major (pkg.version) ) { console.log ('readme version does not match package version'); process.exit (1);