kopia lustrzana https://github.com/OpenDroneMap/NodeODM
Optional output capture in task runner
rodzic
315589c2de
commit
0d61a82129
|
@ -276,8 +276,6 @@ module.exports = class Task{
|
||||||
done();
|
done();
|
||||||
}else done(new Error(`Could not archive .zip file, 7z exited with code ${code}`));
|
}else done(new Error(`Could not archive .zip file, 7z exited with code ${code}`));
|
||||||
}
|
}
|
||||||
}, output => {
|
|
||||||
this.output.push(output);
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -42,8 +42,10 @@ function makeRunner(command, args, requiredOptions = [], outputTestFile = null,
|
||||||
if (outputTestFile){
|
if (outputTestFile){
|
||||||
fs.readFile(path.resolve(__dirname, outputTestFile), 'utf8', (err, text) => {
|
fs.readFile(path.resolve(__dirname, outputTestFile), 'utf8', (err, text) => {
|
||||||
if (!err){
|
if (!err){
|
||||||
|
if (outputReceived !== undefined){
|
||||||
let lines = text.split("\n");
|
let lines = text.split("\n");
|
||||||
lines.forEach(line => outputReceived(line));
|
lines.forEach(line => outputReceived(line));
|
||||||
|
}
|
||||||
|
|
||||||
done(null, 0, null);
|
done(null, 0, null);
|
||||||
}else{
|
}else{
|
||||||
|
@ -71,8 +73,10 @@ function makeRunner(command, args, requiredOptions = [], outputTestFile = null,
|
||||||
.on('exit', (code, signal) => done(null, code, signal))
|
.on('exit', (code, signal) => done(null, code, signal))
|
||||||
.on('error', done);
|
.on('error', done);
|
||||||
|
|
||||||
|
if (outputReceived !== undefined){
|
||||||
childProcess.stdout.on('data', chunk => outputReceived(chunk.toString()));
|
childProcess.stdout.on('data', chunk => outputReceived(chunk.toString()));
|
||||||
childProcess.stderr.on('data', chunk => outputReceived(chunk.toString()));
|
childProcess.stderr.on('data', chunk => outputReceived(chunk.toString()));
|
||||||
|
}
|
||||||
|
|
||||||
return childProcess;
|
return childProcess;
|
||||||
};
|
};
|
||||||
|
|
Ładowanie…
Reference in New Issue