question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DeleteFilesV1 patterns don't find files/folders starting with a dot

See original GitHub issue

Environment

  • Server - Azure Pipelines
  • Agent - Private
    • Windows Server 2016 x64 with Agent 2.144.2

Issue Description

The task DeleteFilesV1 doesn’t find files or folders starting with a dot with its patterns. This differs from CopyFilesV2, which does copy files/folders starting with a dot. So if you use the same pattern in both a copy and a delete task, not all copied files will be deleted.

The problem is here: https://github.com/Microsoft/azure-pipelines-tasks/blob/master/Tasks/DeleteFilesV1/deletefiles.ts#L59-L65 Custom matchOptions are passed, but dot: true is not set. Compare to https://github.com/Microsoft/azure-pipelines-task-lib/blob/master/node/task.ts#L1413-L1426 where this and many other options are set by default, but not used for DeleteFilesV1 because custom options are passed.

Task logs

Nothing interesting here

2019-01-30T15:04:12.6948075Z ##[section]Starting: Delete archived source
2019-01-30T15:04:12.6952288Z ==============================================================================
2019-01-30T15:04:12.6952378Z Task         : Delete Files
2019-01-30T15:04:12.6952431Z Description  : Delete files or folders. (The minimatch patterns will only match file paths, not folder paths)
2019-01-30T15:04:12.6952484Z Version      : 1.1.6
2019-01-30T15:04:12.6952552Z Author       : Microsoft Corporation
2019-01-30T15:04:12.6952604Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=722333)
2019-01-30T15:04:12.6952929Z ==============================================================================
2019-01-30T15:04:16.4039069Z ##[section]Finishing: Delete archived source

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mjrogheliacommented, Oct 29, 2020

@anatolybolshakov Sounds like a task issue. Could you please investigate?

0reactions
vladislav-ryzhovcommented, May 24, 2021

Let me close it at the moment since it’s resolved - please let us know if you have any further questions!

Read more comments on GitHub >

github_iconTop Results From Across the Web

DeleteFiles@1 - Delete files v1 task - Microsoft Learn
Use this task to delete files or folders from the agent working directory. Examples. Delete several patterns. This example will delete some/file ......
Read more >
How to delete all files in a current directory starting with a dot?
Every directory contains a file called . which refers to the ... This will delete all files starting with a dot containing at...
Read more >
How to delete a folder that name ended with a dot (".")?
Navigate File Explorer to location where problematic folder is located. Context menu (right mouse button) > Git Bash Here. rm -rf Foldername./.
Read more >
How do I remove all files that match a pattern? - Ask Ubuntu
Use the find command (with care!) find . -name '*.orig' #-delete. I've commented out the delete command but once you're happy with what...
Read more >
Find Files Faster: How to Organize Files and Folders - Zapier
Nested folders generally make it easier to find specific files later, because you don't have to sift through all your files at once....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found