Skip to content

Commit

Permalink
(GH-198) Only add pending if directory is known
Browse files Browse the repository at this point in the history
If the package install directory is unknown, it means that the package
already did not install successfully, so don't take any action on
setting the pendingFile. Do the same during the removal of the pending
file.
  • Loading branch information
ferventcoder committed May 28, 2016
1 parent 3f2831e commit 2f435fa
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,7 @@ private void remove_rollback_if_exists(PackageResult packageResult)
public void set_pending(PackageResult packageResult, ChocolateyConfiguration config)
{
var packageDirectory = packageResult.InstallLocation;
if (string.IsNullOrWhiteSpace(packageDirectory)) return;
if (packageDirectory.is_equal_to(ApplicationParameters.InstallLocation) || packageDirectory.is_equal_to(ApplicationParameters.PackagesLocation))
{
packageResult.Messages.Add(
Expand All @@ -1076,6 +1077,7 @@ public void set_pending(PackageResult packageResult, ChocolateyConfiguration con
public void remove_pending(PackageResult packageResult, ChocolateyConfiguration config)
{
var packageDirectory = packageResult.InstallLocation;
if (string.IsNullOrWhiteSpace(packageDirectory)) return;
if (packageDirectory.is_equal_to(ApplicationParameters.InstallLocation) || packageDirectory.is_equal_to(ApplicationParameters.PackagesLocation))
{
packageResult.Messages.Add(
Expand Down

0 comments on commit 2f435fa

Please sign in to comment.