Skip to content

Commit

Permalink
fix: fix build tools bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanyxh committed Aug 16, 2024
1 parent 8d42801 commit f7e4eb6
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,20 @@ export const generateRouteJSONWithExample = async () => {
export const generateRouteJSONWithTools = async () => {
let tools = '';

const dirs = readdirSync(resolve('./src/tools'));
try {
const dirs = readdirSync(resolve('./src/tools'));

for (let i = 0; i < dirs.length; i++) {
const name = dirs[i];
for (let i = 0; i < dirs.length; i++) {
const name = dirs[i];

tools += `{
path: '${name + '.html'}',
element: () => import('@/tools/${name}/Index.tsx')
},
`;
tools += `{
path: '${name + '.html'}',
element: () => import('@/tools/${name}/Index.tsx')
},
`;
}
} catch (err) {
console.log(err);
}

return { tools };
Expand Down

0 comments on commit f7e4eb6

Please sign in to comment.