File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
build/tasks/tasks-powershell Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -3,18 +3,19 @@ Task powershell-format-code {
3
3
$PSScriptAnalyzerExclusions = ' (artifacts)|(packages)'
4
4
$Settings = Join-Path $BuildRoot ' build/settings/powershell-formatting-settings.psd1'
5
5
Write-Build DarkGray ' Applying Formatting to All PS1 Files'
6
- $files = & git diff -- name- only -- diff- filter= d | Where-Object { $_ -like ' *.ps1' } |
7
- ForEach-Object { Get-Item - Path $_ } |
8
- Where-Object FullName -NotMatch $PSScriptAnalyzerExclusions
6
+ $files = & git status -- porcelain | Where-Object { $_ -notmatch ' ^D' } |
7
+ ForEach-Object { $_.TrimStart (' ADMR ' ) } |
8
+ ForEach-Object { Get-Item - Path $_ } |
9
+ Where-Object { $_ -like ' *.ps1' } |
10
+ Where-Object FullName -NotMatch $PSScriptAnalyzerExclusions
9
11
Write-Build DarkGray " Total Files to Process: $ ( @ ($Files ).Count) "
10
12
$x = 0
11
13
$id = Get-Random
12
14
Write-Progress - Id $id - Activity ' Formatting Files' - PercentComplete 0
13
15
$files | ForEach-Object {
14
16
$f = $_
15
17
[string ]$content = ([System.IO.File ]::ReadAllText($f.FullName )).Trim()
16
- if (-not $Content )
17
- {
18
+ if (-not $Content ) {
18
19
Write-Build DarkGray " Bypassed: $ ( $f.Name ) per empty"
19
20
continue
20
21
}
You can’t perform that action at this time.
0 commit comments