require repository and description

This commit is contained in:
Timo Hocker 2020-05-12 10:02:18 +02:00
parent 1bd7125c84
commit 63a459b1db
2 changed files with 28 additions and 6 deletions

View File

@ -25,6 +25,16 @@ child_process.execSync ('yarn lint', { stdio: 'inherit' });
child_process.execSync ('yarn test', { stdio: 'inherit' });
child_process.execSync ('yarn compile', { stdio: 'inherit' });
if (typeof pkg.description === 'undefined' || pkg.description === '') {
console.log ('description undefined');
process.exit (1);
}
if (typeof pkg.repository === 'undefined') {
console.log ('repository undefined');
process.exit (1);
}
if (fs.existsSync ('README.md')) {
const readme = fs.readFileSync ('README.md', 'utf-8');
// eslint-disable-next-line prefer-named-capture-group
@ -32,9 +42,10 @@ if (fs.existsSync ('README.md')) {
if (
typeof version === 'undefined'
|| version[1] !== pkg.version
)
) {
console.log ('readme version does not match package version');
else
child_process.execSync ('yarn publish --access public');
process.exit (1);
}
else { child_process.execSync ('yarn publish --access public'); }
}
`;

View File

@ -16,6 +16,16 @@ child_process.execSync ('yarn lint', { stdio: 'inherit' });
child_process.execSync ('yarn test', { stdio: 'inherit' });
child_process.execSync ('yarn compile', { stdio: 'inherit' });
if (typeof pkg.description === 'undefined' || pkg.description === '') {
console.log ('description undefined');
process.exit (1);
}
if (typeof pkg.repository === 'undefined') {
console.log ('repository undefined');
process.exit (1);
}
if (fs.existsSync ('README.md')) {
const readme = fs.readFileSync ('README.md', 'utf-8');
// eslint-disable-next-line prefer-named-capture-group
@ -23,8 +33,9 @@ if (fs.existsSync ('README.md')) {
if (
typeof version === 'undefined'
|| version[1] !== pkg.version
)
) {
console.log ('readme version does not match package version');
else
child_process.execSync ('yarn publish --access public');
process.exit (1);
}
else { child_process.execSync ('yarn publish --access public'); }
}