]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Run post hook regardless of error code
authormgummelt <mgummelt@fb.com>
Tue, 12 Jul 2011 21:34:27 +0000 (14:34 -0700)
committermgummelt <mgummelt@fb.com>
Tue, 12 Jul 2011 21:40:32 +0000 (14:40 -0700)
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
src/configuration/ArcanistConfiguration.php

index 6263695356c658acab4bca13eab353320c1d0707..0a7e76d1c4c9e2bb81a21591fab8704fedcd7ae9 100755 (executable)
@@ -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) {
index 64cb22cc425de95054574de2eeb80e1e88d48921..a382ef7af1e3d2774a6725165e95af8fae8e8cb2 100644 (file)
@@ -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.
   }