From 5451d2875221239f8ae151c125c927a1bd43d9ca Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 27 Feb 2020 06:14:32 -0800 Subject: [PATCH] When "ArcanistRuntime" exits with a nonzero exit code, emit that exit code Summary: See . Returning an integer from a top-level PHP file doesn't actually affect the process exit code, as much as I might wish it does. Test Plan: Ran `arc patch adflsnadfsln; echo $?`, saw a nonzero exit code after this fix. Differential Revision: https://secure.phabricator.com/D21037 --- bin/arc | 2 +- bin/phage | 2 +- support/init/init-arcanist.php | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/arc b/bin/arc index 5f6aaf70..51528ca0 100755 --- a/bin/arc +++ b/bin/arc @@ -7,4 +7,4 @@ if (function_exists('pcntl_async_signals')) { declare(ticks = 1); } -return require_once dirname(__DIR__).'/support/init/init-arcanist.php'; +require_once dirname(__DIR__).'/support/init/init-arcanist.php'; diff --git a/bin/phage b/bin/phage index 5f6aaf70..51528ca0 100755 --- a/bin/phage +++ b/bin/phage @@ -7,4 +7,4 @@ if (function_exists('pcntl_async_signals')) { declare(ticks = 1); } -return require_once dirname(__DIR__).'/support/init/init-arcanist.php'; +require_once dirname(__DIR__).'/support/init/init-arcanist.php'; diff --git a/support/init/init-arcanist.php b/support/init/init-arcanist.php index 563ef1e3..c0a04568 100644 --- a/support/init/init-arcanist.php +++ b/support/init/init-arcanist.php @@ -3,4 +3,6 @@ require_once dirname(__FILE__).'/init-script.php'; $runtime = new ArcanistRuntime(); -return $runtime->execute($argv); +$err = $runtime->execute($argv); + +exit($err);