cdbrelease/config.js
Aaron Suen d15799f6a9 Add CDB details sync support.
- Automatically load detail edits from meta JSON, allowing release
  of new descriptions to sync with release of package versions.
- Load long description from external markdown file.
- Automatically calculate provides/depends info if needed.
2020-03-27 17:12:38 -04:00

34 lines
710 B
JavaScript

const process = require('process');
const minimist = require('minimist');
const config = {};
module.exports = config;
const layers = {};
const layord = 'default fromfile fromgit frommeta cmdline'.split(' ');
function set(name, obj) {
if(!layord.find(x => x === name))
throw Error('invalid config layer name');
layers[name] = obj;
Object.keys(config).forEach(k => delete config[k]);
layord.forEach(k => Object.assign(config, layers[k] || {}));
config.set = set;
return config;
}
set('cmdline', minimist(process.argv.slice(2)));
set('default', {
root: 'https://content.minetest.net/',
user: null,
pass: null,
pkg: null,
min: 'none',
max: 'none',
branch: 'master',
timeout: 60,
poll: 2
});