Skip to content

Commit

Permalink
Fix regex to make sure _template.json doesn't appear in members list
Browse files Browse the repository at this point in the history
  • Loading branch information
AjaiKN committed Sep 13, 2023
1 parent e0bb0bd commit 392dc81
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/members.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const members = [];
// and put their contents into the members array.
function importAll(memberRequirer) {
const filenames = memberRequirer.keys();
console.log(filenames);
filenames.forEach((filename) => {
const data = memberRequirer(filename);
if (typeof data !== "object") {
Expand All @@ -26,6 +27,6 @@ function importAll(memberRequirer) {
});
}
// import all json files in the members directory (except for _template.json)
importAll(require.context("./members", true, /^[^_].*\.json$/));
importAll(require.context("./members", true, /\/[^_][^/]+\.json$/));

export default members;

0 comments on commit 392dc81

Please sign in to comment.