|
| 1 | +#Requires -Version 6.0 |
| 2 | +#Requires -PSEdition Core |
| 3 | + |
1 | 4 | <#
|
2 | 5 | .SYNOPSIS
|
3 | 6 | Merge multiple asset tagss worth of content into a single asset tag.
|
@@ -66,9 +69,6 @@ function Git-Command($CommandString, $WorkingDirectory, $HardExit=$true) {
|
66 | 69 | }
|
67 | 70 |
|
68 | 71 | function Resolve-Proxy {
|
69 |
| - # this script requires the presence of git |
70 |
| - Test-Exe-In-Path -ExeToLookFor "git" | Out-Null |
71 |
| - |
72 | 72 | $testProxyExe = "test-proxy"
|
73 | 73 | # this script requires the presence of the test-proxy on the PATH
|
74 | 74 | $proxyToolPresent = Test-Exe-In-Path -ExeToLookFor "test-proxy" -ExitOnError $false
|
@@ -184,7 +184,13 @@ function Start-Message($AssetsJson, $TargetTags, $AssetsRepoLocation, $MountDire
|
184 | 184 | function Finish-Message($AssetsJson, $TargetTags, $AssetsRepoLocation, $MountDirectory) {
|
185 | 185 | $len = $TargetTags.Length
|
186 | 186 |
|
187 |
| - Write-Host "`nSuccessfully combined $len tags. Invoke `"test-proxy push " -NoNewLine |
| 187 | + if ($TargetTags.GetType().Name -eq "String") { |
| 188 | + $len = 1 |
| 189 | + } |
| 190 | + |
| 191 | + $suffix = if ($len -gt 1) { "s" } else { "" } |
| 192 | + |
| 193 | + Write-Host "`nSuccessfully combined $len tag$suffix. Invoke `"test-proxy push " -NoNewLine |
188 | 194 | Write-Host $AssetsJson -ForegroundColor Green -NoNewLine
|
189 | 195 | Write-Host "`" to push the results as a new tag."
|
190 | 196 | }
|
@@ -270,12 +276,22 @@ function Combine-Tags($RemainingTags, $AssetsRepoLocation, $MountDirectory){
|
270 | 276 | # if we have successfully gotten to the end without any non-zero exit codes...delete the mergeprogress file, we're g2g
|
271 | 277 | Cleanup-Incomplete-Progress $MountDirectory
|
272 | 278 |
|
273 |
| - return $pushedTags |
| 279 | + return @($pushedTags) |
274 | 280 | }
|
275 | 281 |
|
276 | 282 | $ErrorActionPreference = "Stop"
|
277 | 283 |
|
278 |
| -# resolve the proxy location so that we can invoke it easily |
| 284 | +# this script requires the presence of git |
| 285 | +Test-Exe-In-Path -ExeToLookFor "git" | Out-Null |
| 286 | + |
| 287 | +# this script expects at least powershell 6 (core) |
| 288 | + |
| 289 | +if ($PSVersionTable["PSVersion"].Major -lt 6) { |
| 290 | + Write-Error "This script requires a version of powershell newer than 6. See http://aka.ms/powershell for resolution." |
| 291 | + exit 1 |
| 292 | +} |
| 293 | + |
| 294 | +# resolve the proxy location so that we can invoke it easily, if not present we exit here. |
279 | 295 | $proxyExe = Resolve-Proxy
|
280 | 296 |
|
281 | 297 | $AssetsJson = Resolve-Path $AssetsJson
|
|
0 commit comments