Skip to content

Commit

Permalink
Throw exception on patch failure if env var is set
Browse files Browse the repository at this point in the history
  • Loading branch information
pivulic authored and cweagans committed Feb 29, 2016
1 parent 6121982 commit 0d75c63
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Patches.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public function gatherPatches(PackageEvent $event) {
// won't hurt anything, so we'll just stash it there.
$this->patches['_patchesGathered'] = TRUE;
}

/**
* Get the patches from root composer or external file
* @return Patches
Expand Down Expand Up @@ -263,6 +263,9 @@ public function postInstall(PackageEvent $event) {
}
catch (\Exception $e) {
$this->io->write(' <error>Could not apply patch! Skipping.</error>');
if (getenv('COMPOSER_EXIT_ON_PATCH_FAILURE')) {
throw new \Exception("Cannot apply patch $description ($url)!");
}
}
}
$localPackage->setExtra($extra);
Expand Down

0 comments on commit 0d75c63

Please sign in to comment.