Debug output tidying
This commit is contained in:
parent
ff59fd7df1
commit
e3a93ceef4
23
cdbedit.js
23
cdbedit.js
@ -24,11 +24,12 @@ module.exports = async () => {
|
||||
const $ = await cdblib.fetch(uri);
|
||||
const fields = cdblib.getfields($);
|
||||
|
||||
const tags = {};
|
||||
let tags = {};
|
||||
meta.tags.split(',')
|
||||
.filter(x => /\S/.test(x))
|
||||
.map(x => x.trim())
|
||||
.forEach(x => tags[cdblib.findopt($, 'select#tags option', x)] = true);
|
||||
tags = Object.keys(tags);
|
||||
delete meta.tags;
|
||||
|
||||
'type license media_license'.split(' ')
|
||||
@ -46,20 +47,22 @@ module.exports = async () => {
|
||||
meta.repo = config.fromgit;
|
||||
|
||||
Object.assign(fields, meta);
|
||||
let body = Object.keys(fields)
|
||||
.sort()
|
||||
.map(k => encodeURIComponent(k) + '=' + encodeURIComponent(fields[k]));
|
||||
Object.keys(tags)
|
||||
.map(k => Number(k))
|
||||
.sort()
|
||||
.forEach(k => body.push('tags=' + k));
|
||||
|
||||
if(config.dryrun) {
|
||||
console.log('dry run; not saving details');
|
||||
console.log(body);
|
||||
fields.tags = tags;
|
||||
console.log(require('util')
|
||||
.inspect(fields));
|
||||
return;
|
||||
}
|
||||
|
||||
let body = Object.keys(fields)
|
||||
.sort()
|
||||
.map(k => encodeURIComponent(k) + '=' + encodeURIComponent(fields[k]));
|
||||
tags.forEach(k => body.push('tags=' + k));
|
||||
body = body.join('&');
|
||||
|
||||
console.log('applying package detail changes...');
|
||||
await cdblib.fetch(uri, 'post', body.join('&'));
|
||||
await cdblib.fetch(uri, 'post', body);
|
||||
console.log('package details updated');
|
||||
};
|
||||
|
@ -33,7 +33,7 @@ async function makerelease() {
|
||||
fields.title = config.version;
|
||||
if(config.dryrun) {
|
||||
console.log('dry run; not submitting');
|
||||
console.log(JSON.stringify(fields));
|
||||
console.log(require('util').inspect(fields));
|
||||
return;
|
||||
}
|
||||
console.log('submitting new release...');
|
||||
|
4
index.js
4
index.js
@ -11,7 +11,7 @@ const cdbedit = require('./cdbedit');
|
||||
const readFile = util.promisify(fs.readFile);
|
||||
|
||||
process.on('unhandledRejection', e => {
|
||||
console.log(e);
|
||||
console.warn(e);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
@ -22,7 +22,7 @@ process.on('unhandledRejection', e => {
|
||||
if(conf)
|
||||
config.set('fromfile', JSON.parse(conf.toString()));
|
||||
} catch (e) {
|
||||
console.log(e.message || e);
|
||||
console.warn(e.message || e);
|
||||
}
|
||||
|
||||
if(config.fromgit)
|
||||
|
Loading…
x
Reference in New Issue
Block a user