Skip to content

Commit

Permalink
chore: Remove file deletion logic but keep refactor of mdxFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
LizBaker committed Jun 17, 2021
1 parent 7e3068f commit 3c023d6
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions scripts/actions/add-files-to-translation-queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ const getUpdatedQueue = async (url, queue) => {
path.join(process.cwd(), file.filename)
);
const { data } = frontmatter(contents);
// if no translate frontmatter or if translate exists and is empty- check that versions of the file don't exist in any locale

// if translate exists check that versions of the file don't exist in any locale we use but isn't included

return data.translate && data.translate.length
? [...files, { ...file, locales: data.translate }]
Expand All @@ -52,16 +49,6 @@ const getUpdatedQueue = async (url, queue) => {
.filter((f) => f.status === 'removed')
.map(prop('filename'));

// if file was deleted, make sure versions don't exist in any locale
removedMdxFileNames.forEach((fileName) =>
fs.unlink(path.join(process.cwd(), fileName), (err) => {
if (err) {
console.log(`failed to delete ${fileName}`, err);
}
console.log(`${fileName} was deleted`);
})
);

const queueFiles =
Object.entries(queue).length !== 0 ? Object.entries(queue) : [];

Expand Down

0 comments on commit 3c023d6

Please sign in to comment.