diff --git a/ci.js b/ci.js index f0c4f71..683cb75 100644 --- a/ci.js +++ b/ci.js @@ -10,6 +10,7 @@ const fs = require ('fs'); const child_process = require ('child_process'); +const { type } = require ('os'); const pkg = JSON.parse (fs.readFileSync ('package.json', 'utf-8')); @@ -24,11 +25,24 @@ if (typeof pkg.description === 'undefined' || pkg.description === '') { ok = false; } -if (typeof pkg.repository === 'undefined') { +if (typeof pkg.repository === 'object') { + if (pkg.repository.type !== 'git') { + console.log ('repository is not of type git'); + ok = false; + } + if (!(/^https:\/\/.+\.git/iu).test (pkg.repository.url)) + console.log ('repo url is not https.git'); +} +else { console.log ('repository undefined'); ok = false; } +if (!(/^https:\/\/.+/iu).test (pkg.bugs)) { + console.log ('issue tracker url not defined'); + ok = false; +} + if (typeof pkg.author === 'object') { if (typeof pkg.author.name !== 'string') { console.log ('author name undefined');