Skip to content

Commit

Permalink
Ignoring files deleted in PR during validation (Azure#1056)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsgouda authored and amarzavery committed Mar 21, 2017
1 parent c570e39 commit cd32a50
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/util/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ exports.getFilesChangedInPR = function getFilesChangedInPR() {
return (item.match(/.*\/swagger\/*/ig) !== null);
});
console.log(`>>>> Number of swaggers found in this PR: ${swaggerFilesInPR.length}`);

var deletedFiles = swaggerFilesInPR.filter(function(swaggerFile){
return !fs.existsSync(swaggerFile);
});
console.log('>>>>> Files deleted in this PR are as follows:')
console.log(deletedFiles);
// Remove files that have been deleted in the PR
swaggerFilesInPR = swaggerFilesInPR.filter(function(x) { return deletedFiles.indexOf(x) < 0 });

result = swaggerFilesInPR;
} catch (err) {
throw err;
Expand Down

0 comments on commit cd32a50

Please sign in to comment.