Fix Hub location

This commit is contained in:
Ryan Brandenburg 2018-04-25 09:48:14 -07:00
parent 43cd223f2f
commit 66d3de5142
2 changed files with 8 additions and 6 deletions

View File

@ -109,6 +109,7 @@ Write-Host "Loading deps from $depsPath"
if (-not $NoCommit) {
$baseBranch = "dev"
Invoke-Block { & git fetch origin }
$currentBranch = Invoke-Block { & git rev-parse --abbrev-ref HEAD }
$destinationBranch = "rybrande/UpgradeDepsTest"

View File

@ -15,7 +15,10 @@ function Invoke-Block([scriptblock]$cmd) {
# - $?: did the powershell script block throw an error
# - $lastexitcode: did a windows command executed by the script block end in error
if ((-not $?) -or ($lastexitcode -ne 0)) {
Write-Warning $error[0]
if(($error -ne $null))
{
Write-Warning $error[0]
}
throw "Command failed to execute: $cmd"
}
}
@ -121,9 +124,8 @@ function Ensure-Hub() {
if (-Not (Test-Path $hubLocation) ) {
$source = "https://github.com/github/hub/releases/download/v2.3.0-pre9/hub-windows-amd64-2.3.0-pre9.zip"
$zipLocation = "$tmpDir\hub.zip"
if(-not (Test-Path $zipLocation)) {
New-Item -ItemType directory -Path $tmpDir
}
mkdir -Path $tmpDir -ErrorAction Ignore | Out-Null
Invoke-WebRequest -OutFile $zipLocation -Uri $source
@ -169,8 +171,7 @@ function CommitUpdatedVersions(
$subject = "Updating external dependencies"
# Have to pipe null so that the output from this doesn't end up as part of the return value
$null = Invoke-Block { & git commit -m $subject }
Invoke-Block { & git commit -m $subject } | Out-Null
$body = "$subject`n`n"