diff --git a/lib/tasks/generateJsdoc.js b/lib/tasks/generateJsdoc.js index f5e245016..425d4027e 100644 --- a/lib/tasks/generateJsdoc.js +++ b/lib/tasks/generateJsdoc.js @@ -31,7 +31,7 @@ module.exports = async function({workspace, options}) { allResources = await workspace.byGlob(options.pattern); } - const {path: tmpDirPath, cleanupCallback} = await createTmpWorkDir(options.projectName); + const {path: tmpDirPath} = await createTmpWorkDir(options.projectName); const tmpSourcePath = path.join(tmpDirPath, "src"); // dir will be created by writing project resources below const tmpTargetPath = path.join(tmpDirPath, "target"); // dir will be created by jsdoc itself const tmpTmpPath = path.join(tmpDirPath, "tmp"); // dir needs to be created by us @@ -58,25 +58,25 @@ module.exports = async function({workspace, options}) { }); console.log(createdResources); - await Promise.all(createdResources.map((resource) => { - return workspace.write(resource); - // TODO: cleanupCallback + await Promise.all(createdResources.map(async (resource) => { + await workspace.write(resource); })); }; function createTmpWorkDir(projectName) { return new Promise((resolve, reject) => { tmp.dir({ - prefix: `ui5-tooling-tmp-jsdoc-${projectName}-` - }, (err, path, cleanupCallback) => { + prefix: `ui5-tooling-tmp-jsdoc-${projectName}-`, + // keep: true, + unsafeCleanup: true + }, (err, path) => { if (err) { reject(err); return; } resolve({ - path, - cleanupCallback + path }); }); });