Skip to content

Commit

Permalink
use join in loadMemberFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
danieltott committed Oct 3, 2024
1 parent 947813c commit fd4fffd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/loadMemberFiles.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
var fs = require('fs');
var path = require('path');

function loadMemberFiles(dir) {
const filenames = [];

fs.readdirSync(`./src/content/members/${dir}`, {
fs.readdirSync(path.join('.', 'src', 'content', 'members', dir), {
withFileTypes: true,
}).forEach((file) => {
if (
Expand All @@ -16,7 +17,7 @@ function loadMemberFiles(dir) {
});

fs.writeFileSync(
`./src/data/members/${dir}.ts`,
path.join('.', 'src', 'data', 'members', `${dir}.ts`),
filenames
.map(
(name) => `export * from '@/content/members/${dir}/${name}';`,
Expand Down

0 comments on commit fd4fffd

Please sign in to comment.