Welcome to mirror list, hosted at ThFree Co, Russian Federation.

clean.ps1 - github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 955b03c41d760dd66fdb7c700133f6c748487234 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#requires -version 5

<#
.SYNOPSIS
Clean this repository.

.DESCRIPTION
This script cleans this repository interactively, leaving downloaded infrastructure untouched.
Clean operation is interactive to avoid losing new but unstaged files. Press 'c' then [Enter]
to perform the proposed deletions.

.EXAMPLE
Perform default clean operation.

    clean.ps1

.EXAMPLE
Clean everything but downloaded infrastructure and VS / VS Code folders.

    clean.ps1 -e .vs/ -e .vscode/
#>

[CmdletBinding(PositionalBinding = $false)]
param(
    # Other lifecycle targets
    [switch]$Help, # Show help

    # Capture the rest
    [Parameter(ValueFromRemainingArguments = $true)]
    [string[]]$GitArguments
)

Set-StrictMode -Version 2
$ErrorActionPreference = 'Stop'

if ($Help) {
    Get-Help $PSCommandPath
    exit 0
}

git clean -dix -e .dotnet/ -e .tools/ @GitArguments
git checkout -- $(git ls-files -d)