From 63a459b1db175cc54b418ba944ac3adb2e8b05fc Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Tue, 12 May 2020 10:02:18 +0200 Subject: [PATCH] require repository and description --- asset_jenkins.js | 17 ++++++++++++++--- jenkins.js | 17 ++++++++++++++--- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/asset_jenkins.js b/asset_jenkins.js index a4d25b7..7049470 100644 --- a/asset_jenkins.js +++ b/asset_jenkins.js @@ -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'); } } `; diff --git a/jenkins.js b/jenkins.js index 3caa43a..041edf6 100644 --- a/jenkins.js +++ b/jenkins.js @@ -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'); } }