From 7af9d9083aac8da918937a2892f28e2a8cb6e53f Mon Sep 17 00:00:00 2001 From: cha0s Date: Sun, 4 Feb 2024 14:13:14 -0600 Subject: [PATCH] ci: continue on fail --- build/tasks.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/build/tasks.js b/build/tasks.js index e670362..ed7f0fc 100644 --- a/build/tasks.js +++ b/build/tasks.js @@ -7,25 +7,19 @@ const { FLECKS_CORE_ROOT = process.cwd(), } = process.env; +const args = ['npm', 'run', ...process.argv.slice(2)]; const {workspaces} = require(join(FLECKS_CORE_ROOT, 'package.json')); (async () => { - const paths = ( - await Promise.all(workspaces.map((workspace) => glob(join(FLECKS_CORE_ROOT, workspace)))) - ) + const paths = (await Promise.all(workspaces.map((path) => glob(join(FLECKS_CORE_ROOT, path))))) .flat(); const cpus = new Array(require('os').cpus().length).fill(Promise.resolve(0)); for (let i = 0; i < paths.length; ++i) { + // then= :) cpus[i % cpus.length] = cpus[i % cpus.length] - .then( - ((cwd) => ( - (code) => { - return 0 === code - ? processCode(spawnWith(['npm', 'run', ...process.argv.slice(2)], {cwd})) - : code; - } - ))(paths[i]), - ); + .then(((cwd) => async (code) => ( + (await processCode(spawnWith(args, {cwd}))) || code + ))(paths[i])); } process.exitCode = (await Promise.all(cpus)).find((code) => code !== 0) || 0; })();