flecks/build/tasks.js

21 lines
558 B
JavaScript
Raw Normal View History

2024-02-04 13:55:14 -06:00
const {join} = require('path');
const {processCode, spawnWith} = require('@flecks/core/src/server');
const {glob} = require('glob');
2024-02-09 01:11:27 -06:00
const concurrent = require('./concurrent');
2024-02-04 13:55:14 -06:00
const {
FLECKS_CORE_ROOT = process.cwd(),
} = process.env;
2024-02-09 01:11:27 -06:00
const args = process.argv.slice(2);
2024-02-04 13:55:14 -06:00
const {workspaces} = require(join(FLECKS_CORE_ROOT, 'package.json'));
(async () => {
2024-02-09 01:11:27 -06:00
process.exitCode = await concurrent(
(await Promise.all(workspaces.map((path) => glob(join(FLECKS_CORE_ROOT, path))))).flat(),
(cwd) => processCode(spawnWith(args, {cwd})),
);
2024-02-04 13:55:14 -06:00
})();