Compare commits
3 Commits
28fae0cf69
...
f89082563a
Author | SHA1 | Date | |
---|---|---|---|
f89082563a | |||
01dc0b4d4a | |||
1c4224adf6 |
37
ci.js
37
ci.js
@ -5,12 +5,12 @@
|
||||
* Created by Timo Hocker <timo@scode.ovh>, May 2020
|
||||
*/
|
||||
|
||||
/* eslint-disable */
|
||||
|
||||
/* eslint-disable no-console, no-process-exit, prefer-named-capture-group */
|
||||
'use strict';
|
||||
|
||||
const fs = require ('fs');
|
||||
const child_process = require ('child_process');
|
||||
const { type } = require ('os');
|
||||
|
||||
const pkg = JSON.parse (fs.readFileSync ('package.json', 'utf-8'));
|
||||
|
||||
@ -25,11 +25,40 @@ 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');
|
||||
ok = false;
|
||||
}
|
||||
|
||||
if (typeof pkg.author.email !== 'string') {
|
||||
console.log ('author email undefined');
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
console.log ('author not in object format');
|
||||
ok = false;
|
||||
}
|
||||
|
||||
function major (version) {
|
||||
return version.replace (/\.[0-9x]+$/ui, '');
|
||||
}
|
||||
@ -63,7 +92,7 @@ if (fs.existsSync ('CHANGELOG.md')) {
|
||||
}
|
||||
else {
|
||||
console.log ('changelog does not exist');
|
||||
// ok = false; disable until all modules have a changelog
|
||||
ok = false;
|
||||
}
|
||||
|
||||
if (ok)
|
||||
|
Loading…
x
Reference in New Issue
Block a user