From 7490da8139cb3e7a93067092c7fcf2dc115dccc2 Mon Sep 17 00:00:00 2001 From: mgummelt Date: Tue, 12 Jul 2011 14:34:27 -0700 Subject: [PATCH] Run post hook regardless of error code Summary: In order to support more flexible post hooks. Also send the error code to the hook for use by client code. Test Plan: None Reviewed By: epriestley Reviewers: epriestley CC: dpepper, aran, epriestley Differential Revision: 656 --- scripts/arcanist.php | 4 +--- src/configuration/ArcanistConfiguration.php | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/arcanist.php b/scripts/arcanist.php index 62636953..0a7e76d1 100755 --- a/scripts/arcanist.php +++ b/scripts/arcanist.php @@ -303,9 +303,7 @@ try { $config->willRunWorkflow($command, $workflow); $workflow->willRunWorkflow(); $err = $workflow->run(); - if ($err == 0) { - $config->didRunWorkflow($command, $workflow); - } + $config->didRunWorkflow($command, $workflow, $err); exit($err); } catch (ArcanistUsageException $ex) { diff --git a/src/configuration/ArcanistConfiguration.php b/src/configuration/ArcanistConfiguration.php index 64cb22cc..a382ef7a 100644 --- a/src/configuration/ArcanistConfiguration.php +++ b/src/configuration/ArcanistConfiguration.php @@ -103,7 +103,8 @@ class ArcanistConfiguration { // This is a hook. } - public function didRunWorkflow($command, ArcanistBaseWorkflow $workflow) { + public function didRunWorkflow($command, ArcanistBaseWorkflow $workflow, + $err) { // This is a hook. }