Skip to content

Commit

Permalink
Skipping the file if it was not found (microsoft#774)
Browse files Browse the repository at this point in the history
Implemented checking for the presence of a file and skipping it if it does not exist
  • Loading branch information
DenisRumyantsev committed Jul 16, 2021
1 parent 078c422 commit 80eaeb9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion node/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "azure-pipelines-task-lib",
"version": "3.1.4",
"version": "3.1.5",
"description": "Azure Pipelines Task SDK",
"main": "./task.js",
"typings": "./task.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions node/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,10 @@ export function find(findPath: string, options?: FindOptions): string[] {
while (stack.length) {
// pop the next item and push to the result array
let item = stack.pop()!; // non-null because `stack.length` was truthy
if (!fs.existsSync(item.path)) {
debug(`File "${item.path}" seems to be removed during find operation execution - so skipping it.`);
continue;
}
result.push(item.path);

// stat the item. the stat info is used further below to determine whether to traverse deeper
Expand Down

0 comments on commit 80eaeb9

Please sign in to comment.