run-in-all
Version:
A CLI tool to run the same npm-script in multiple directories in parallel or sequential.
43 lines • 1.14 kB
JavaScript
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const yargs = require("yargs");
const runner_1 = require("./runner");
const options = yargs
.usage('run-in-all [command] [directories...]')
.option('a', {
alias: 'args',
describe: 'Run the command with args.',
type: 'string',
demandOption: false,
default: '',
})
.option('p', {
alias: 'parallel',
describe: 'Run the command in all directories in parallel.',
type: 'boolean',
demandOption: false,
default: false,
})
.option('s', {
alias: 'silent',
describe: 'Run the command silently, without the command output.',
type: 'boolean',
demandOption: false,
default: false,
})
.option('y', {
alias: 'yarn',
describe: 'Run the command with yarn.',
type: 'boolean',
demandOption: false,
default: false,
}).argv;
const [command, ...directories] = options._;
runner_1.runCommandInDirs(command, directories, {
isYarn: options.y,
args: options.a,
parallel: options.p,
silent: options.s,
}).then(process.exit);
//# sourceMappingURL=index.js.map