Skip to content

Commit

Permalink
Move path config back to main file
Browse files Browse the repository at this point in the history
  • Loading branch information
paescuj committed Dec 26, 2024
1 parent 1441fc2 commit 02a224f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
11 changes: 9 additions & 2 deletions bin/build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const tasks = new Listr(
{
title: 'Fetching icons',
task: async (ctx) => {
ctx.tasks = { global: { rootDir, defaultVariant }, icons: {} };
ctx.tasks = { global: { defaultVariant }, icons: {} };

const iconsVariantsDirs = Object.fromEntries(
iconsVariants.map((variant) => [
Expand Down Expand Up @@ -84,7 +84,14 @@ const tasks = new Listr(
Object.entries(targets).map(([targetName, targetConfig]) => ({
title: targetConfig.title,
enabled: () => ctx.cliTargets.length === 0 || ctx.cliTargets.includes(targetName),
task: async (ctx) => ctx.pool.run({ targetName, config: ctx.tasks, targetConfig }),
task: (ctx) => {
targetConfig.path = path.join(
rootDir,
...targetConfig.path.split(path.posix.sep),
);

return ctx.pool.run({ targetName, config: ctx.tasks, targetConfig });
},
})),
{ concurrent: true, exitOnError: false },
),
Expand Down
7 changes: 0 additions & 7 deletions bin/build/worker.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import path from 'node:path';

export default async ({ targetName, config, targetConfig }) => {
const { default: task } = await import(
`./targets/${targetConfig.target || targetName}/index.js`
);

targetConfig.path = path.join(
config.global.rootDir,
...targetConfig.path.split(path.posix.sep),
);

return task(config, targetConfig);
};

0 comments on commit 02a224f

Please sign in to comment.