Navigation Menu

Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

Commit

Permalink
reference chocolateyErrored from script scope in chocolatey.ps1 in ca…
Browse files Browse the repository at this point in the history
…se chocolatey is intercepted from a module (like boxstarter)
  • Loading branch information
mwrock authored and ferventcoder committed Jan 22, 2015
1 parent bed27e2 commit 9b77483
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/chocolatey.ps1
Expand Up @@ -166,7 +166,7 @@ if ($forceX86) {

$env:chocolateyPackageParameters = $packageParameters

$chocolateyErrored = $false
$script:chocolateyErrored = $false
$badPackages = ''

#todo: This does not catch package names that come later
Expand All @@ -193,7 +193,7 @@ foreach ($packageName in $packageNames) {
}
}
catch {
$chocolateyErrored = $true
$script:chocolateyErrored = $true
Write-Host "$($_.Exception.Message)" -BackgroundColor $ErrorColor -ForegroundColor White ;
if ($badPackages -ne '') { $badPackages += ', '}
$badPackages += "$packageName"
Expand All @@ -208,7 +208,7 @@ if ($badPackages -ne '') {
Write-Host "Command `'$command`' failed (sometimes this indicates a partial failure). Additional info/packages: $badpackages" -BackgroundColor $ErrorColor -ForegroundColor White
}

if ($chocolateyErrored) {
if ($script:chocolateyErrored) {
Write-Debug "Exiting with non-zero exit code."
exit 1
}
Expand Down

0 comments on commit 9b77483

Please sign in to comment.