diff --git a/tasks/after-pack/register-archive-hook.js b/tasks/after-pack/register-archive-hook.js index 3ccc914dca..7b8e928265 100644 --- a/tasks/after-pack/register-archive-hook.js +++ b/tasks/after-pack/register-archive-hook.js @@ -8,8 +8,6 @@ * except in compliance with the MIT License. */ -const del = require('del').deleteSync; - const archiver = require('archiver'); const fs = require('fs'); @@ -95,11 +93,9 @@ async function archive(path, archivePath, archiveType) { console.log(` • re-building file=${archivePath}, archiveType=${archiveType}`); + await del(archivePath); return new Promise(function(resolve, reject) { - - del(archivePath); - var archive, output; @@ -126,4 +122,10 @@ async function archive(path, archivePath, archiveType) { archive.directory(path, 'camunda-modeler').finalize(); }); -} \ No newline at end of file +} + +async function del(path) { + const delModule = await import('del'); + + return delModule.deleteAsync(path); +} diff --git a/tasks/link-dependencies.js b/tasks/link-dependencies.js index a5bfc5838e..386223964f 100644 --- a/tasks/link-dependencies.js +++ b/tasks/link-dependencies.js @@ -10,7 +10,6 @@ const fs = require('fs'); const { shellSync: exec } = require('execa'); -const { deleteSync: del } = require('del'); const path = require('path'); const customLinkersMap = { @@ -75,7 +74,7 @@ async function linkDependencies(dependencies) { return; } - del(dependenciesDir); + await del(dependenciesDir); fs.mkdirSync(dependenciesDir); for (const dependency of dependencies) { @@ -223,3 +222,9 @@ function gitClone(repo) { function getRepoUrl(repo) { return `https://github.com/${repo}.git`; } + +async function del(path) { + const delModule = await import('del'); + + return delModule.deleteAsync(path); +}