Skip to content

Commit

Permalink
fix: 🐛 patch iterating through existing cwl files for removal
Browse files Browse the repository at this point in the history
  • Loading branch information
slugb0t committed Aug 27, 2024
1 parent 3aa0a06 commit e5b2424
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions bot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -593,11 +593,10 @@ export default async (app, { getRouter }) => {
cwlObject.contains_cwl = cwlExists.contains_cwl_files;

if (cwlExists.files.length > 0) {
consola.info("CWL Validation rerun:", cwlObject);
// Remove the files that are not in cwlObject
const cwlFilePaths = cwlObject.files.map((file) => file.path);
cwlObject.removed_files = cwlExists.files.filter((file) => {
consola.info(file);
return !cwlObject.files.path.includes(file.path);
return !cwlFilePaths.includes(file.path);
});
}
}
Expand Down Expand Up @@ -652,11 +651,10 @@ export default async (app, { getRouter }) => {
cwlObject.contains_cwl = cwlExists.contains_cwl_files;

if (cwlExists.files.length > 0) {
consola.info("CWL Validation rerun:", cwlObject);
// Remove the files that are not in cwlObject
const cwlFilePaths = cwlObject.files.map((file) => file.path);
cwlObject.removed_files = cwlExists.files.filter((file) => {
consola.info(file);
return !cwlObject.files.includes(file.path);
return !cwlFilePaths.includes(file.path);
});
}
}
Expand Down

0 comments on commit e5b2424

Please sign in to comment.