cake-build / cake

:cake: Cake (C# Make) is a cross platform build automation system.
https://cakebuild.net
MIT License
3.87k stars 727 forks source link

Ability to force clean readonly files #4077

Closed FrankRay78 closed 1 year ago

FrankRay78 commented 1 year ago

This PR successfully addresses #1317, 'CleanDirectory does not clean readonly files.'

I have familarised myself with #1574 when making this change (as @bjorkstromm mentioned) and in a similar manner, introduced a CleanDirectorySettings class which has a Force flag that defaults to false, but when enabled, will ensure the DirectoryCleaner will force clean readonly files.

I avoided making this a breaking change by creating overloads of the DirectoryCleaner methods that take an additional CleanDirectorySettings parameter, and did the same for the various DirectoryAliases methods.

If it was, however, decided that every clean method should take a settings parameter, we can keep the overloaded methods and simply remove the initial methods that didn't accept CleanDirectorySettings.

augustoproiete commented 1 year ago

@FrankRay78 your changes have been merged, thanks for your contribution :+1: