mirror of
https://github.com/yldio/copilot.git
synced 2024-11-14 23:30:05 +02:00
24 lines
469 B
Plaintext
24 lines
469 B
Plaintext
|
#!/usr/bin/env node
|
||
|
|
||
|
const argv = require('yargs').argv;
|
||
|
const forEach = require('apr-for-each');
|
||
|
const main = require('apr-main');
|
||
|
const execa = require('execa');
|
||
|
const path = require('path');
|
||
|
|
||
|
const ROOT = process.cwd();
|
||
|
|
||
|
if (!argv.cmd) {
|
||
|
throw new Error('Missing --cmd argument');
|
||
|
}
|
||
|
|
||
|
const run = () =>
|
||
|
forEach(argv._, file =>
|
||
|
execa('yarn', ['run', argv.cmd], {
|
||
|
cwd: path.dirname(path.join(ROOT, file)),
|
||
|
stdio: 'inherit'
|
||
|
})
|
||
|
);
|
||
|
|
||
|
main(run());
|