Files
all-commons/release.ps1

35 lines
852 B
PowerShell

[CmdletBinding()]
param(
[string]$Prefix = "v",
[string]$Message = "正式发布",
[switch]$AutoCommit,
[switch]$RequireClean,
[string]$CommitMessage,
[switch]$DryRun
)
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$candidates = @(
(Join-Path $scriptDir "..\jiangchang-platform-kit\tools\release.ps1"),
(Join-Path $scriptDir "..\..\jiangchang-platform-kit\tools\release.ps1")
)
$sharedScript = $null
foreach ($c in $candidates) {
$resolved = [System.IO.Path]::GetFullPath($c)
if (Test-Path $resolved) {
$sharedScript = $resolved
break
}
}
if ($null -ne $sharedScript) {
& $sharedScript @PSBoundParameters
exit $LASTEXITCODE
}
Write-Host "Release failed: jiangchang-platform-kit/tools/release.ps1 not found." -ForegroundColor Red
exit 1