Summary:
If you type `arc`, you currently get a fatal since $config isn't defined. Don't try to run the hook if we never built a config.
(We could build the config earlier and then run the hook anyway, but $workflow and $command would not be defined. It seems unlikely that executing the hook here is useful, since it affects only the case that the user types `arc` on its own.)
Test Plan: Typed `arc`. Typed `arc diff`, etc.
Reviewers: vrana, btrahan
Reviewed By: vrana
CC: aran
Differential Revision: https://secure.phabricator.com/D3841
$working_directory = getcwd();
$console = PhutilConsole::getConsole();
+$config = null;
try {
$user_config = ArcanistBaseWorkflow::readUserConfigurationFile();
- $config = $working_copy->getConfig('arcanist_configuration');
- if ($config) {
- $config = new $config();
+ $config_class = $working_copy->getConfig('arcanist_configuration');
+ if ($config_class) {
+ $config = new $config_class();
} else {
$config = new ArcanistConfiguration();
}
$ex->getMessage());
}
- $config->didAbortWorkflow($command, $workflow, $ex);
+ if ($config) {
+ $config->didAbortWorkflow($command, $workflow, $ex);
+ }
if ($config_trace_mode) {
echo "\n";