Skip to content

Commit

Permalink
docs: ChangesByExtension example ( Fixes #292 )
Browse files Browse the repository at this point in the history
Trimming rename extensions
  • Loading branch information
James Brundage committed Sep 25, 2024
1 parent 964fc97 commit a1ee6fc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Examples/ChangesByExtension.ugit.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ if ($currentBranchName -eq $headBranch) {
}

$currentBranchCommits = git log "$($gitRemote.RemoteName)/$headBranch..$CurrentBranch" -Statistics
$changesByExtension = $currentBranchCommits.Changes | Group-Object { ($_.FilePath -split '\.')[-1]}
$changesByExtension = $currentBranchCommits |
Foreach-Object { $_.Changes } |
Group-Object { ($_.FilePath -split '\.')[-1] -replace '\p{P}+$'}

if ($env:GITHUB_STEP_SUMMARY) {
"
Expand All @@ -30,8 +32,7 @@ $(
foreach ($changeSet in $changesByExtension) {
" $($changeSet.Name): $(($changeSet.Group.LinesChanged | Measure-Object -Sum).Sum)"
}
) -join [Environment]::NewLine
)
) -join [Environment]::NewLine)
~~~
" |
Expand Down

0 comments on commit a1ee6fc

Please sign in to comment.