Last active
March 20, 2019 17:27
-
-
Save icavalheiro/810686f40de1165c76afddf8a6dc7f84 to your computer and use it in GitHub Desktop.
CSX script to delete all files that follow a pattern from the current directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env dotnet-script | |
| /* | |
| You will need dotnet core and "dotnet tool install -g dotnet-script" | |
| */ | |
| using System; | |
| using System.IO; | |
| var files = Directory.GetFiles("./", "._*", SearchOption.AllDirectories); | |
| foreach (var file in files) | |
| { | |
| Console.WriteLine("deleting file: " + file); | |
| File.Delete(file); | |
| } | |
| Console.WriteLine("Done"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment