From 7a0d885813e56b6859694fe5df00d1c3f123c58e Mon Sep 17 00:00:00 2001 From: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> Date: Tue, 2 Feb 2021 21:42:23 -0700 Subject: [PATCH] fix(tools): Modiify removeDeletedFiles function to find all files instead of just markdown (#40887) * fix: corrected file deletion function * fix(tools): include dict Signed-off-by: nhcarrigan * fix(tools): concat is non-mutating oops Signed-off-by: nhcarrigan Co-authored-by: nhcarrigan --- tools/crowdin/actions/remove-deleted-files/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/crowdin/actions/remove-deleted-files/index.js b/tools/crowdin/actions/remove-deleted-files/index.js index 3cd07adbc0..1a015cdf6d 100644 --- a/tools/crowdin/actions/remove-deleted-files/index.js +++ b/tools/crowdin/actions/remove-deleted-files/index.js @@ -23,9 +23,13 @@ const removeDeletedFiles = async projectId => { const crowdinFiles = await getFiles(projectId); if (crowdinFiles && crowdinFiles.length) { - const command = 'find curriculum/challenges/english -name \\*.md'; - const listOfEnglishFiles = await getOutputFromCommand(command); - const curriculumFilesArr = listOfEnglishFiles.split('\n'); + const challengeCommand = 'find curriculum/challenges/english -name \\*.*'; + const listOfEnglishFiles = await getOutputFromCommand(challengeCommand); + const dictionaryCommand = + 'find curriculum/dictionaries/english -name \\*.*'; + const listOfDictFiles = await getOutputFromCommand(dictionaryCommand); + let curriculumFilesArr = listOfEnglishFiles.split('\n'); + curriculumFilesArr = curriculumFilesArr.concat(listOfDictFiles.split('\n')); if (curriculumFilesArr.length) { const curriculumLookup = curriculumFilesArr.reduce((obj, filename) => { return { ...obj, [filename]: 1 };