Skip to content

Instantly share code, notes, and snippets.

@Nejat
Created December 3, 2018 02:56
Show Gist options
  • Save Nejat/8fdc0fd00738d37c0871dce7d73beabb to your computer and use it in GitHub Desktop.
Save Nejat/8fdc0fd00738d37c0871dce7d73beabb to your computer and use it in GitHub Desktop.
clean build artifacts and packages ... .Net, Gradle, Node
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