1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 08:12:40 +01:00

Only inject legacy Arcanist workflows into "help" if run from the context of an Arcanist runtime

Summary: Ref T13490. This code is reachable from Phabricator binaries; only inject the legacy stuff if we're in an Arcanist stack.

Test Plan: Ran `bin/conduit help` from `phabricator/`.

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21113
This commit is contained in:
epriestley 2020-04-14 12:45:49 -07:00
parent d408a80ae1
commit 9d0100bda7

View file

@ -40,42 +40,44 @@ EOHELP
$with = $args->getArg('help-with-what'); $with = $args->getArg('help-with-what');
$runtime = $this->getRuntime(); $runtime = $this->getRuntime();
$toolset = $runtime->getToolset(); if ($runtime) {
if ($toolset->getToolsetKey() === 'arc') { $toolset = $runtime->getToolset();
$workflows = $args->getWorkflows(); if ($toolset->getToolsetKey() === 'arc') {
$workflows = $args->getWorkflows();
$legacy = array(); $legacy = array();
$legacy[] = new ArcanistCloseRevisionWorkflow(); $legacy[] = new ArcanistCloseRevisionWorkflow();
$legacy[] = new ArcanistCommitWorkflow(); $legacy[] = new ArcanistCommitWorkflow();
$legacy[] = new ArcanistCoverWorkflow(); $legacy[] = new ArcanistCoverWorkflow();
$legacy[] = new ArcanistDiffWorkflow(); $legacy[] = new ArcanistDiffWorkflow();
$legacy[] = new ArcanistExportWorkflow(); $legacy[] = new ArcanistExportWorkflow();
$legacy[] = new ArcanistGetConfigWorkflow(); $legacy[] = new ArcanistGetConfigWorkflow();
$legacy[] = new ArcanistSetConfigWorkflow(); $legacy[] = new ArcanistSetConfigWorkflow();
$legacy[] = new ArcanistInstallCertificateWorkflow(); $legacy[] = new ArcanistInstallCertificateWorkflow();
$legacy[] = new ArcanistLandWorkflow(); $legacy[] = new ArcanistLandWorkflow();
$legacy[] = new ArcanistLintersWorkflow(); $legacy[] = new ArcanistLintersWorkflow();
$legacy[] = new ArcanistLintWorkflow(); $legacy[] = new ArcanistLintWorkflow();
$legacy[] = new ArcanistListWorkflow(); $legacy[] = new ArcanistListWorkflow();
$legacy[] = new ArcanistPatchWorkflow(); $legacy[] = new ArcanistPatchWorkflow();
$legacy[] = new ArcanistPasteWorkflow(); $legacy[] = new ArcanistPasteWorkflow();
$legacy[] = new ArcanistTasksWorkflow(); $legacy[] = new ArcanistTasksWorkflow();
$legacy[] = new ArcanistTodoWorkflow(); $legacy[] = new ArcanistTodoWorkflow();
$legacy[] = new ArcanistUnitWorkflow(); $legacy[] = new ArcanistUnitWorkflow();
$legacy[] = new ArcanistWhichWorkflow(); $legacy[] = new ArcanistWhichWorkflow();
foreach ($legacy as $workflow) { foreach ($legacy as $workflow) {
// If this workflow has been updated but not removed from the list // If this workflow has been updated but not removed from the list
// above yet, just skip it. // above yet, just skip it.
if ($workflow instanceof ArcanistArcWorkflow) { if ($workflow instanceof ArcanistArcWorkflow) {
continue; continue;
}
$workflows[] = $workflow->newLegacyPhutilWorkflow();
} }
$workflows[] = $workflow->newLegacyPhutilWorkflow(); $args->setWorkflows($workflows);
} }
$args->setWorkflows($workflows);
} }
if (!$with) { if (!$with) {