Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return file => {
const env = Object.create(process.env, {FILE: {value: file}});
const parts = parseShellQuote(command, env);
const child = spawn(parts[0], parts.slice(1), {env});
const outer = duplexer(child.stdin, child.stdout);
child.on("exit", function(code) {
if (code !== 0) {
outer.emit(
"error",
new Error("non-zero exit code in command: " + command));
}
});
child.stderr.pipe(process.stderr);
return outer;
};
});
const createReporter = () => {
const output = through2();
const p = parser();
const stream = duplexer(p, output);
const startedAt = Date.now();
const println = (input = '', indentLevel = 0) => {
let indent = '';
for (let i = 0; i < indentLevel; ++i) {
indent += INDENT;
}
input.split('\n').forEach(line => {
output.push(`${indent}${line}`);
output.push('\n');
});
};
const handleTest = name => {