ci: continue on fail

This commit is contained in:
cha0s 2024-02-04 14:13:14 -06:00
parent 68b007a078
commit 7af9d9083a

View File

@ -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;
})();