Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
test
  • Loading branch information
PedroBailaAndrade committed Jan 8, 2024
1 parent 94787fc commit 468b086
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions workspaces/cms-scripts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,22 @@ const createAnnouncementDetails = async () => {

const jsonFilesInDir = filesInDir.filter((file) => file.endsWith(".json"));

if (jsonFilesInDir.length > 0) {
for (const fileName of jsonFilesInDir) {
const fileData = await fs.readFile(
path.join(
process.cwd(),
"public/data/announcements",
locale,
fileName
),
"utf8"
);

const { blocks, gitlog, sourceFilepath, objectID, ...roadmapDetails }: AnnouncementsPost = JSON.parse(fileData.toString());
roadmapPosts.push(roadmapDetails);
}
await write(path.join("public/data/announcements-details", `${locale}.json`), roadmapPosts);
for (const fileName of jsonFilesInDir) {
const fileData = await fs.readFile(
path.join(
process.cwd(),
"public/data/announcements",
locale,
fileName
),
"utf8"
);

const { blocks, gitlog, sourceFilepath, objectID, ...roadmapDetails }: AnnouncementsPost = JSON.parse(fileData.toString());
roadmapPosts.push(roadmapDetails);
}
await write(path.join("public/data/announcements-details", `${locale}.json`), roadmapPosts);
}
}

Expand Down Expand Up @@ -283,5 +282,5 @@ const redirects = await yaml("_data/settings/redirects.yml");

await write(`workspaces/website/redirects.json`, redirects);
await createRoadmapDetails()
await createAnnouncementDetails()
// await createAnnouncementDetails()
await createSharedData()

0 comments on commit 468b086

Please sign in to comment.