-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add -r for recursive cleanup #5
Comments
Hello @kzu The idea is that the tool acts like many other .NET Global Tools and work on a per-project-basis. So if the command is run in a folder and it contains a Never really thought about supporting recursion, but it should be too hard :) I'll look into it! |
yeah, I think the scenario in my case is where you run it on the root of a repo, which typically contains one or more solutions down to the |
Hello again @kzu. Sorry for the slow response. I started exploring the concept of a recursive If you have a reasonable sized project, it would search trough every sub-folder, including every folder (and sub-folder) of code, and look for In your case, if the functionality of this .NET Global Tool would be as intended, you should just be able to point it towards your (one or multiple) What are your thoughts? |
Hi @sebnilsson! One of the things I do quite frequently is run a shell tool to "Clean Sources" that I've been keeping around for years now (from before Scott even blogged about it ;)): It's still one of the first things I install when I revamp the machine or get a new one. that common it is to do this sort of cleanup. For repos with multiple solutions, submodules, and what-not, it's a must have. Passing a sln to your tool will typically not be enough IMHO. I'm curious as to why you think the feature itself doesn't make sense though. Sure, the implementation won't be super trivial, but I can run that shell extension shown above on fairly large repos with sub-second performance. |
The implementation should not be too hard, but does it make sense to recursively look through all folders, down the line in a normal sized repository, to see if there are One level of recursion might make sense, to try to cover scenarios of projects laying in a sub-folder, but that should be covered by just pointing the tool toward the correct Basically, I'm just trying to understand what scenario is not covered by a simple PowerShell-script looping all folders in your If I understand your use-case and what is not covered in above suggestion, I might add it, even if it doesn't make complete sense, just for the practice 😄. |
I can use powershell all-right, but in that case, why would I use your tool at all? ;) The point is precisely not to have to use powershell and just rely on a simple dotnet CLI tool to do the job. Again, if the scenario itself didn't make sense, that Clean Sources tool would have never existed in the first place. Any repo with complex submodules that are built as part of a build script and not an .sln would benefit from this feature, I think :). |
I think all the .NET Global Tools that I've used work on folders, But again, I'm up for the pure problem-solving of it all. What is the expected behavior in your book? Just point it to your root I see a risk in a too broad application that might not work for most people, but I'm open to your thoughts on the matter. |
Yep, walking and killing folders recursively, plain and simple. Exactly as the Clean Sources shell extension mentioned above does. Sure, it won't be great for everyone, which is why they would need to explicitly opt-in with the This is basically the gist of it: https://stackoverflow.com/questions/755382/i-want-to-delete-all-bin-and-obj-folders-to-force-all-projects-to-rebuild-everyt ;) |
I was hoping it would do recursive folders cleanup out of the box, but maybe a
-r
switch would do?Thoughts?
The text was updated successfully, but these errors were encountered: