-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdateNovaModuleVersion.ps1
More file actions
32 lines (25 loc) · 1.09 KB
/
Copy pathUpdateNovaModuleVersion.ps1
File metadata and controls
32 lines (25 loc) · 1.09 KB
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
function Update-NovaModuleVersion {
[CmdletBinding(SupportsShouldProcess = $true)]
param(
[string]$Path = (Get-Location).Path,
[switch]$Preview,
[switch]$ContinuousIntegration
)
$projectRoot = (Resolve-Path -LiteralPath $Path).Path
if ($ContinuousIntegration -and -not $WhatIfPreference) {
$ciActivatedCommand = Get-NovaVersionUpdateCiActivatedCommand -ProjectRoot $projectRoot
if ($null -ne $ciActivatedCommand) {
return & $ciActivatedCommand @PSBoundParameters
}
}
$workflowContext = Get-NovaVersionUpdateWorkflowContext -ProjectRoot $projectRoot -PreviewRelease:$Preview -ContinuousIntegrationRequested:$ContinuousIntegration
$shouldRun = $PSCmdlet.ShouldProcess($workflowContext.Target, $workflowContext.Action)
$result = Invoke-NovaVersionUpdateWorkflow -WorkflowContext $workflowContext -ShouldRun:$shouldRun -WhatIfEnabled:$WhatIfPreference
if ($null -eq $result) {
return
}
if ($result.Applied) {
Write-Host "Version bumped to : $( $result.NewVersion )"
}
return $result
}