* [codeshift] add proper ignore comments * [codeshift] apply require-to-import transform * [codeshift/fixup] remove duplicate imports * [eslint] upgrade config for react "unused" support * [codeshift] apply remove-unused-imports transform * [codeshift] apply remove-unused-basic-requires transform * [codeshift] apply remove-unused-function-arguments transform * [lintroller] fix argument list spacing * [codeshift] apply remove-unused-basic-bars transform * [codeshift/fixup] fixup unused basic var removals * manually apply remove-unused-assignments transform * [codeshift] reapply remove-unused-imports transform * [codeshift] reapply remove-unused-function-arguments transform * [eslint] autofix param spacing * manually fix remaining no-undef errors * use more descriptive file ignore pattern * add eslint-plugin-react peerDependency * replace values that looked unused in tests * remove // kibana-jscodeshift-no-babel comment * remove import statements from code required by api tests * Remove '// kibana-jscodeshift-ignore' comments * address review feedback * remove remnant of removed if condition
26 lines
518 B
JavaScript
26 lines
518 B
JavaScript
import { execFileSync } from 'child_process';
|
|
|
|
function exec(cmd, args, opts) {
|
|
console.log(' >', cmd, args.join(' '));
|
|
exec.silent(cmd, args, opts);
|
|
}
|
|
|
|
exec.silent = function (cmd, args, opts) {
|
|
opts = opts || {};
|
|
if (!opts.stdio) opts.stdio = ['ignore', 1, 2];
|
|
try {
|
|
execFileSync(cmd, args, opts);
|
|
} catch (e) {
|
|
if (opts.stdio[1] !== 1) {
|
|
console.log(e.stdout + '');
|
|
}
|
|
|
|
if (opts.stdio[2] !== 2) {
|
|
console.log(e.stderr + '');
|
|
}
|
|
|
|
throw e;
|
|
}
|
|
};
|
|
|
|
module.exports = exec;
|