From 2e49c6b97e810b0f5f61d1363fe7d92858b0d4ba Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Tue, 27 Aug 2024 11:47:06 -0400 Subject: [PATCH] Remove datetimeModified --- bin/update-member | 24 +++++------------------- contrib/example-schema.json | 1 - src/content/config.ts | 1 - src/content/members/sentry.json | 1 - 4 files changed, 5 insertions(+), 22 deletions(-) diff --git a/bin/update-member b/bin/update-member index 01a184f2..8b4125e2 100755 --- a/bin/update-member +++ b/bin/update-member @@ -32,25 +32,11 @@ async function updateMember(name, url) { console.error(`ERROR: Failed to get JSON from ${url}`, e); process.exit(1); } - - let shouldWrite = (localMemberData == undefined); - - if (!shouldWrite) { - const localMtime = new Date(localMemberData.datetimeModified); - const remoteMtime = new Date(remoteMemberData.datetimeModified); - shouldWrite = remoteMtime > localMtime; - } - - if (shouldWrite) { - console.log(`Remote JSON is newer, writing to ${localPath}`); - try { - fs.writeFileSync(localPath, JSON.stringify(remoteMemberData, null, 2)); - } catch (e) { - console.error(`ERROR: Failed to write to ${localPath}`, e); - process.exit(1); - } - } else { - console.log("Remote JSON is older, skipping"); + try { + fs.writeFileSync(localPath, JSON.stringify(remoteMemberData, null, 2)); + } catch (e) { + console.error(`ERROR: Failed to write to ${localPath}`, e); + process.exit(1); } } diff --git a/contrib/example-schema.json b/contrib/example-schema.json index 330a8563..f8d6f02d 100644 --- a/contrib/example-schema.json +++ b/contrib/example-schema.json @@ -1,6 +1,5 @@ { "domain": "example.com", - "datetimeModified": "2024-08-05T01:00:00Z", "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", "name": "Acme Widgets", "urlSquareLogoWithBackground": "https://avatars.githubusercontent.com/u/1396951?s=200&v=4", diff --git a/src/content/config.ts b/src/content/config.ts index 5eb6b1e9..6933dfdb 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -29,7 +29,6 @@ const memberProvidedData = z.object({ const member = z.object({ domain: z.string(), - datetimeModified: z.string().datetime(), }).merge(memberProvidedData); export type Member = z.infer; diff --git a/src/content/members/sentry.json b/src/content/members/sentry.json index 5e478141..741b0cc0 100644 --- a/src/content/members/sentry.json +++ b/src/content/members/sentry.json @@ -1,6 +1,5 @@ { "domain": "sentry.io", - "datetimeModified": "2024-08-05T01:00:00Z", "description": "Sentry started life as an Open Source side project in 2008. We grew that way for years before commercializing. We've always given back to the community and now we're happy to help other companies do the same through the Open Source Pledge.", "name": "Sentry", "urlSquareLogoWithBackground": "https://avatars.githubusercontent.com/u/1396951?s=200&v=4",