{"action":"opened","issue":{"url":"https://api.github.com/repos/yevhen/Nake/issues/12","labels_url":"https://api.github.com/repos/yevhen/Nake/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/yevhen/Nake/issues/12/comments","events_url":"https://api.github.com/repos/yevhen/Nake/issues/12/events","html_url":"https://github.com/yevhen/Nake/issues/12","id":61617107,"number":12,"title":"FS.RemoveDir does not handle exclusion pattern for files","user":{"login":"vansha","id":147127,"avatar_url":"https://avatars.githubusercontent.com/u/147127?v=3","gravatar_id":"","url":"https://api.github.com/users/vansha","html_url":"https://github.com/vansha","followers_url":"https://api.github.com/users/vansha/followers","following_url":"https://api.github.com/users/vansha/following{/other_user}","gists_url":"https://api.github.com/users/vansha/gists{/gist_id}","starred_url":"https://api.github.com/users/vansha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vansha/subscriptions","organizations_url":"https://api.github.com/users/vansha/orgs","repos_url":"https://api.github.com/users/vansha/repos","events_url":"https://api.github.com/users/vansha/events{/privacy}","received_events_url":"https://api.github.com/users/vansha/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-14T14:17:57Z","updated_at":"2015-03-14T14:17:57Z","closed_at":null,"body":"I've followed this example from [Nake.csx](https://github.com/yevhen/Nake/blob/bb05a4dbb9ebd8300af0d567b17cd2d4cb2271d3/Nake.csx#L30):\r\n```csharp\r\nRemoveDir(@\"**\\bin|**\\obj|{path}\\*|-:*.vshost.exe\");    \r\n```\r\n\r\nExpecting that folders containing `*.vshost.exe` files (presumably locked by VS) would not be removed.\r\nHowever Nake tries to remove them according to this message:\r\n\r\n```\r\nRemoving directory \"C:\\projects\\..\\someproj\\bin\".\r\nMSBUILD : error MSB3231: Unable to remove directory \"C:\\projects\\..\\someproj\\bin\". Access to the path SomeProj.vshost.exe' is denied.\r\nMicrosoft.Build.Tasks.RemoveDir failed\r\n```\r\n\r\nProbably such exclusion for files should not be used with `RemoveDir`, as it is not really consistent with FileSet exclusion semantics. But on the other hand, such exclusion looks very handy. So I'm not sure whether it worth it to fix behavior. Or it's better to fix `Nake.csx` instead :)\r\n\r\nOther possible approach could be adding a standard `ContinueOnError` msbuild parameter to the `RemoveDir` extension."}}