Skip to content

Commit

Permalink
dates work 11
Browse files Browse the repository at this point in the history
  • Loading branch information
wkelly17 committed Nov 19, 2024
1 parent cdb48b4 commit f36e3ed
Show file tree
Hide file tree
Showing 2 changed files with 498 additions and 8 deletions.
12 changes: 5 additions & 7 deletions actions/dates/dates.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@ async function run() {
console.log(
`Received ${allFilesInGit.length} all files and ${filesModifiedInCommit.length} modified files`
);
console.log("modified files");
console.log(filesModifiedInCommit);
console.log("all files");
console.log(allFilesInGit);

const metaDataUpdated = allFilesInGitArr.reduce((acc, file) => {
const isModified = filesModifiedArr.includes(file);
const isInExistingMeta = Object.hasOwnProperty(metaParsed, file);
if (isModified || !isInExistingMeta) {
const existingDate = metaParsed[file];
if (isModified || !existingDate) {
console.log(`Updating metadata for ${file} to new date`);
acc[file] = new Date().toISOString();
} else {
acc[file] = metaParsed[file];
acc[file] = existingDate;
}
return acc;
}, {});
Expand Down
Loading

0 comments on commit f36e3ed

Please sign in to comment.