ensure up to date readme

This commit is contained in:
Timo Hocker 2020-05-12 09:50:57 +02:00
parent 86aa9103ac
commit 1bd7125c84
2 changed files with 24 additions and 17 deletions

View File

@ -25,12 +25,16 @@ child_process.execSync ('yarn lint', { stdio: 'inherit' });
child_process.execSync ('yarn test', { stdio: 'inherit' }); child_process.execSync ('yarn test', { stdio: 'inherit' });
child_process.execSync ('yarn compile', { stdio: 'inherit' }); child_process.execSync ('yarn compile', { stdio: 'inherit' });
child_process.exec ('git log -1 | grep \\'\\\\[no publish\\\\]\\'') if (fs.existsSync ('README.md')) {
.addListener ('exit', (code) => { const readme = fs.readFileSync ('README.md', 'utf-8');
if (code === 0) { // eslint-disable-next-line prefer-named-capture-group
console.log ('build not marked for deployment'); const version = (/version: ([0-9.]+)/ui).exec (readme);
process.exit (1); if (
} typeof version === 'undefined'
else { child_process.execSync ('yarn publish --access public'); } || version[1] !== pkg.version
}); )
console.log ('readme version does not match package version');
else
child_process.execSync ('yarn publish --access public');
}
`; `;

View File

@ -16,12 +16,15 @@ child_process.execSync ('yarn lint', { stdio: 'inherit' });
child_process.execSync ('yarn test', { stdio: 'inherit' }); child_process.execSync ('yarn test', { stdio: 'inherit' });
child_process.execSync ('yarn compile', { stdio: 'inherit' }); child_process.execSync ('yarn compile', { stdio: 'inherit' });
child_process.exec ('git log -1 | grep \'\\[no publish\\]\'') if (fs.existsSync ('README.md')) {
.addListener ('exit', (code) => { const readme = fs.readFileSync ('README.md', 'utf-8');
if (code === 0) { // eslint-disable-next-line prefer-named-capture-group
console.log ('build not marked for deployment'); const version = (/version: ([0-9.]+)/ui).exec (readme);
process.exit (1); if (
} typeof version === 'undefined'
else { child_process.execSync ('yarn publish --access public'); } || version[1] !== pkg.version
}); )
console.log ('readme version does not match package version');
else
child_process.execSync ('yarn publish --access public');
}