allow version wildcard

This commit is contained in:
Timo Hocker 2020-05-13 20:28:06 +02:00
parent 7b46234832
commit 49fab71c15
3 changed files with 5 additions and 5 deletions

View File

@ -2,7 +2,7 @@
[![Package quality](https://packagequality.com/badge/%40sapphirecode%2Fstandard)](https://packagequality.com/#?package=%40sapphirecode%2Fstandard) [![Package quality](https://packagequality.com/badge/%40sapphirecode%2Fstandard)](https://packagequality.com/#?package=%40sapphirecode%2Fstandard)
version: 1.0.18 version: 1.0.x
standard files and scripts for sapphirecode modules standard files and scripts for sapphirecode modules

View File

@ -35,12 +35,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)

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)