joyent-portal/scripts/license-to-fail

31 lines
767 B
Plaintext
Raw Normal View History

#!/usr/bin/env node
const forEach = require('apr-for-each');
const execa = require('execa');
const globby = require('globby');
const main = require('apr-main');
const argv = require('yargs').argv;
const path = require('path');
const config = path.join(__dirname, '../.licensesrc.json');
const CWD = path.join(__dirname, '..');
const BIN = path.join(CWD, 'node_modules/.bin/license-to-fail');
const run = async (dirs = []) =>
2017-05-30 01:04:51 +03:00
forEach(dirs, async dir =>
execa(BIN, [config], {
cwd: dir,
stdio: 'inherit'
})
);
const all = async () => {
const files = await globby(['{packages,prototypes}/*/', '.'], {
cwd: CWD
});
return run(files.filter(pathname => !/node_modules/.test(pathname)));
};
main(argv._.length ? run(argv._) : all());