Save task output file

pull/143/head
Piero Toffanin 2021-02-05 16:24:58 -05:00
rodzic 82a6e5699f
commit 7a16fe22c4
2 zmienionych plików z 15 dodań i 0 usunięć

Wyświetl plik

@ -376,6 +376,15 @@ module.exports = class Task{
};
};
const saveTaskOutput = (destination) => {
return (done) => {
fs.writeFile(destination, this.output.join("\n"), err => {
if (err) logger.info(`Cannot write log at ${destination}, skipping...`);
done();
});
};
}
// All paths are relative to the project directory (./data/<uuid>/)
let allPaths = ['odm_orthophoto/odm_orthophoto.tif',
'odm_orthophoto/odm_orthophoto.png',
@ -384,6 +393,7 @@ module.exports = class Task{
'odm_dem/dsm.tif', 'odm_dem/dtm.tif', 'dsm_tiles', 'dtm_tiles',
'orthophoto_tiles', 'potree_pointcloud', 'entwine_pointcloud',
'images.json', 'cameras.json',
'task_output.txt',
'odm_report'];
// Did the user request different outputs than the default?
@ -423,6 +433,9 @@ module.exports = class Task{
}
if (!this.skipPostProcessing) tasks.push(runPostProcessingScript());
const taskOutputFile = path.join(this.getProjectFolderPath(), 'task_output.txt');
tasks.push(saveTaskOutput(taskOutputFile));
const archiveFunc = config.has7z ? createZipArchive : createZipArchiveLegacy;
tasks.push(archiveFunc('all.zip', allPaths));

Wyświetl plik

@ -0,0 +1,2 @@
test output