forked from ravendb/ravendb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cleanup.ps1
22 lines (17 loc) · 884 Bytes
/
cleanup.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$path = split-path -parent $MyInvocation.MyCommand.Definition
$title = "Cleanup"
$message = "Do you want to DELETE all uncommited files in " + $path + "?"
$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", `
"Deletes all uncommited files in the folder."
$no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", `
"Retains all uncommited files in the folder."
$options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no)
$result = $host.ui.PromptForChoice($title, $message, $options, 1)
switch ($result)
{
0 {
Get-ChildItem $path -Include bin,obj,build -Recurse -Force | Select -ExpandProperty FullName | Where {$_ -notlike '*Imports*' -and $_ -notlike '*pvc-packages*'} | Remove-Item -Force -Recurse
&"C:\Program Files (x86)\Git\bin\git.exe" clean -f -x -d
}
1 { return; }
}