mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-17 05:02:23 +08:00
FIX problem with building all examples in CI (offset was wrong)
This commit is contained in:
parent
811b66ba05
commit
5eda5b9ad8
@ -150,18 +150,21 @@ const handleExamples = async (deployables) => {
|
||||
};
|
||||
|
||||
const run = async () => {
|
||||
const examples = await readdir(p(['examples']));
|
||||
const list = getDeployables(await readdir(p(['examples'])));
|
||||
|
||||
const { length } = examples;
|
||||
const { length } = list;
|
||||
const [a, b] = [process.env.CIRCLE_NODE_INDEX || 0, process.env.CIRCLE_NODE_TOTAL || 1];
|
||||
const step = Math.ceil(length / b);
|
||||
const offset = step * a;
|
||||
|
||||
const list = examples.slice().splice(offset, step);
|
||||
const deployables = getDeployables(list);
|
||||
const deployables = list.slice().splice(offset, step);
|
||||
|
||||
if (deployables.length) {
|
||||
logger.log(`will build: ${deployables.join(', ')}`);
|
||||
logger.log(
|
||||
`will build: ${deployables.join(', ')} (${
|
||||
deployables.length
|
||||
} total - offset: ${offset} | step: ${step})`
|
||||
);
|
||||
await handleExamples(deployables);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user