Skip to content

Commit

Permalink
💡 (Get-ReleaseDescription.ps1): add log messages to indicate running …
Browse files Browse the repository at this point in the history
…git commands

Adding log messages before running `git log` and `git diff` commands provides better visibility into the script's execution flow. This helps in debugging and understanding which part of the script is currently being executed.
  • Loading branch information
MrHinsh committed Aug 7, 2024
1 parent de74f6b commit c4fb8ba
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions build/include/Get-ReleaseDescription.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ function Get-ReleaseDescription {
$compairTo = "main"
}
Write-Host "Comparing: $compairFrom...$compairTo"
Write-Host "-----------------------------------------"

Write-Host "-----------------------------------------"
switch ($mode)
{
"log" {
Write-Host "Running: git log"
$result = git log --pretty=format:'{\"hash\": \"%H\", \"author\": \"%an\", \"date\": \"%ad\", \"message\": \"%s\"}' "$compairFrom...$compairTo"
}
"diff" {
Write-Host "Running: git diff"
$diffOutPut = git diff "$compairFrom...$compairTo"
$joineddiffOutPut = $diffOutPut -join "`n"
$splitdiffOutPut = $joineddiffOutPut -split "diff --git"
Expand All @@ -57,7 +58,7 @@ function Get-ReleaseDescription {
return
}
}

Write-Host "-----------------------------------------"
If ([string]::IsNullOrEmpty($result) ) {
Write-Host "No changes found"
return
Expand Down

0 comments on commit c4fb8ba

Please sign in to comment.