From f89082563a5c101b34ed8554a498b8653b1bbe99 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Sun, 19 Jul 2020 10:52:15 +0200 Subject: [PATCH] require repository and issue tracker url --- ci.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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');