Skip to content

Commit

Permalink
tools deploy enhanced summary message
Browse files Browse the repository at this point in the history
  • Loading branch information
silverqx committed Aug 14, 2024
1 parent bf9d085 commit 5c6f760
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tools/deploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -985,15 +985,23 @@ function Show-DiffSummaryAndApprove {
[Parameter(
HelpMessage = 'Specifies the folder for which to show git diff, is pwd by default.')]
[ValidateNotNullOrEmpty()]
[string[]] $Path = (Get-Location).Path
[string[]] $Path = (Get-Location).Path,

# Don't use an enum for this, it would be too many unnecessary mappings up and down
[Parameter(Mandatory,
HelpMessage = 'Specifies the name of updated artifacts (used in the info message).')]
[ValidateNotNullOrEmpty()]
[ValidateSet('number of unit tests', 'versions', 'vcpkg port')]
[string]
$SummaryFor
)

Write-Progress 'Showing diff summary...'
NewLine
git --no-pager diff --compact-summary $Path

NewLine
Write-Info 'Please check updated versions in SmartGit...'
Write-Info "Please check updated $SummaryFor in SmartGit..."
Approve-Continue -Exit
}

Expand Down Expand Up @@ -1576,7 +1584,7 @@ function Invoke-UpdateNumberOfUnitTests {

Edit-NumberOfUnitTestsInAllFiles

Show-DiffSummaryAndApprove
Show-DiffSummaryAndApprove -SummaryFor 'number of unit tests'

NewLine
Write-Progress 'Committing updated number of unit tests...'
Expand Down Expand Up @@ -1623,7 +1631,7 @@ function Invoke-BumpVersions {
Edit-VersionNumbersInVersionHpp
Edit-VersionNumbersInAllFiles

Show-DiffSummaryAndApprove
Show-DiffSummaryAndApprove -SummaryFor versions

NewLine
Write-Progress 'Committing bumped version numbers...'
Expand Down Expand Up @@ -1707,7 +1715,7 @@ function Invoke-UpdateVcpkgPorts {
Remove-PortVersions
}

Show-DiffSummaryAndApprove -Path (Resolve-Path .\cmake\vcpkg)
Show-DiffSummaryAndApprove -Path (Resolve-Path .\cmake\vcpkg) -SummaryFor 'vcpkg port'

NewLine
Write-Progress 'Committing vcpkg REF and SHA512...'
Expand Down

0 comments on commit 5c6f760

Please sign in to comment.