Created
December 3, 2018 02:56
-
-
Save Nejat/8fdc0fd00738d37c0871dce7d73beabb to your computer and use it in GitHub Desktop.
clean build artifacts and packages ... .Net, Gradle, Node
This file contains 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
param ( | |
[bool] $ForReals = $false | |
) | |
$color = 'White' | |
if (!$ForReals) { | |
$color = 'DarkGray' | |
} | |
$include = 'bin','obj','build','out','.gradle','node_modules','dist' | |
Get-ChildItem . -Recurse -Include $include -Directory ` | |
| ForEach-Object { | |
$path = $_.FullName | |
Write-Host "Removing $path ..." -ForegroundColor $color | |
if ($ForReals) { | |
Remove-Item -Path $path -Recurse -Force | |
} | |
} | |
$include = '*.approved.txt.bak','*.recevied.txt' | |
Get-ChildItem . -Recurse -Include $include -File ` | |
| ForEach-Object { | |
$path = $_.FullName | |
Write-Host "Removing $path ..." -ForegroundColor $color | |
if ($ForReals) { | |
Remove-Item -Path $path | |
} | |
} | |
Write-Host "Squeaky Clean!" -ForegroundColor DarkCyan |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment