diff --git a/scripts/release/copyReleaseToProject.js b/scripts/release/copyReleaseToProject.js index 065326391f..9e7b89015a 100644 --- a/scripts/release/copyReleaseToProject.js +++ b/scripts/release/copyReleaseToProject.js @@ -17,12 +17,11 @@ async function main() { // Get pluggable widget folders containing "-native" const widgetFolderNames = await asyncFilter(await readdir(pluggableWidgetsFolderPath), isNativeWidgetFolder); const mpkPathsToCopy = []; - for await (const widgetFolderName of widgetFolderNames) { + for (const widgetFolderName of widgetFolderNames) { const widgetDistFolderPath = join(pluggableWidgetsFolderPath, widgetFolderName, "dist"); - const widgetDistFolderNames = await readdir(widgetDistFolderPath); const allMpkPaths = []; - for await (const widgetDistFolderName of widgetDistFolderNames) { + for (const widgetDistFolderName of await readdir(widgetDistFolderPath)) { // Check if folder name contains versioning if (!/\d+\.\d+\.\d+/.test(widgetDistFolderName)) { continue; @@ -46,14 +45,17 @@ async function main() { console.log( `Finished copying ${mpkPathsToCopy.length} widgets to Mendix project ${basename(process.env.MX_PROJECT_PATH)}` ); -}; +} async function asyncFilter(array, fn) { return Promise.all(array.map(fn)).then(booleans => array.filter((_, i) => booleans[i])); } async function isNativeWidgetFolder(widgetFolderName) { - return widgetFolderName.includes("-native") && (await stat(join(pluggableWidgetsFolderPath, widgetFolderName))).isDirectory(); + return ( + widgetFolderName.includes("-native") && + (await stat(join(pluggableWidgetsFolderPath, widgetFolderName))).isDirectory() + ); } async function getFileModifiedTime(path) {