Skip to content

Commit

Permalink
(chocolatey-community#27) add try finally around directory changes
Browse files Browse the repository at this point in the history
Co-Authored-By: James Ruskin <[email protected]>
  • Loading branch information
TheCakeIsNaOH and JPRuskin committed Jul 13, 2024
1 parent 10d86f6 commit aca7afd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,14 @@ build_script:
Write-Host ("{0}`n{1}`n" -f ('-'*60), "PACKAGE: $package")
$package_dir = ls -recurse | ? { $_.Name -eq "$package.nuspec"} | select -First 1 | % Directory
if (!$package_dir) { Write-Warning "Can't find package '$package'"; continue }
pushd $package_dir
try {
pushd $package_dir
if (Test-Path update.ps1 -ea 0) { ./update.ps1 }
choco pack; Push-Package;
popd
choco pack
Push-Package
} finally {
popd
}
}
return
}
Expand Down

0 comments on commit aca7afd

Please sign in to comment.