Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: add remove_files_by_mask helper #7080

Merged
merged 1 commit into from May 26, 2020

Conversation

SSE4
Copy link
Contributor

@SSE4 SSE4 commented May 25, 2020

closes: #7062
Changelog: Feature: Add remove_files_by_mask helper
Docs: conan-io/docs#1713

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.

@uilianries
Copy link
Member

uilianries commented May 25, 2020

What about creating tools.remove(<path|parttern>) instead?

tools.remove(os.path.join("foo", "bar", "baz.txt"))
tools.remove("foo/bar/baz.txt")
tools.remove("foo/bar/*.txt")
tools.remove("foo/*/*.la")

@SSE4
Copy link
Contributor Author

SSE4 commented May 25, 2020

@uilianries that for sure would be breaking, as for some file-systems / (slash) and * (asterisk) are valid characters that could be a part of the file name. in this case, it's non obvious if you're specifying character as a part of the file name, or as an wildcard/mask.

conans/client/tools/files.py Outdated Show resolved Hide resolved
@memsharded memsharded added this to the 1.26 milestone May 26, 2020
@memsharded memsharded requested a review from danimtb May 26, 2020
Copy link
Member

@danimtb danimtb left a comment

Agree with @memsharded, removed_files as relative to the given directory would be better IMO

Signed-off-by: SSE4 <tomskside@gmail.com>
@SSE4 SSE4 force-pushed the remove_files_by_mask branch from f4bb8fd to 0870bec Compare May 26, 2020
@memsharded memsharded merged commit 837922f into conan-io:develop May 26, 2020
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] add remove remove_files_by_mask helper
4 participants