fix(scripts): use bun's glob api correctly

This commit is contained in:
Jozef Steinhübl 2024-01-02 11:27:02 +01:00
parent cda50448db
commit 7150bf4a44
No known key found for this signature in database
GPG key ID: E944BC293F5FF7E7

View file

@ -19,14 +19,11 @@ if (!files.some((f) => f.includes("tags"))) process.exit(0);
const errors: string[] = []; const errors: string[] = [];
const TAGS_PATH = join(import.meta.dir, "..", "..", "data", "tags");
const tags: Tag[] = []; const tags: Tag[] = [];
const tagPaths = Array.from( const tagPaths = Array.from(new Glob("*.md").scanSync(TAGS_PATH));
new Glob(
join(import.meta.dir, "..", "..", "..", "data", "tags", "*.md")
).scanSync()
);
for (const tagPath of tagPaths) { for (const tagPath of tagPaths) {
const content = readFileSync(tagPath); const content = readFileSync(join(TAGS_PATH, tagPath));
const frontMatter = matter(content); const frontMatter = matter(content);
tags.push({ tags.push({