From 03a9c516eaa25ff1dd4d300f8b56762b64ccf5ed Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Mon, 23 Jan 2012 15:31:56 -0800 Subject: [PATCH] Make arc install-certificate respect --conduit-uri Summary: ...basically by adding "getConduitURI" and then falling through to that, rather than repeating work from the main arc wrapper that setConduitURI in the first place. The explicit drawback here is the error message gets a little more vague. Test Plan: - arc install-certifate --conduit-uri=https://secure.phabricator.com // verified that the install flow was going for https://secure.phabricator.com...! - arc install-certificate https://secure.phabricator.com // verified that the install flow was going for https://secure.phabricator.com...! - arc install-certificate // verified that it reverted back to the .arcconfig conduit uri Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley Maniphest Tasks: T794 Differential Revision: https://secure.phabricator.com/D1468 --- src/workflow/base/ArcanistBaseWorkflow.php | 9 +++++++++ .../ArcanistInstallCertificateWorkflow.php | 10 ++-------- src/workflow/install-certificate/__init__.php | 1 - 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/workflow/base/ArcanistBaseWorkflow.php b/src/workflow/base/ArcanistBaseWorkflow.php index 2960505d..b8b8f024 100644 --- a/src/workflow/base/ArcanistBaseWorkflow.php +++ b/src/workflow/base/ArcanistBaseWorkflow.php @@ -96,6 +96,15 @@ class ArcanistBaseWorkflow { return $this; } + /** + * Returns the URI the conduit connection within the workflow uses. + * + * @return string + * @task conduit + */ + final public function getConduitURI() { + return $this->conduitURI; + } /** * Open a conduit channel to the server which was previously configured by diff --git a/src/workflow/install-certificate/ArcanistInstallCertificateWorkflow.php b/src/workflow/install-certificate/ArcanistInstallCertificateWorkflow.php index fa307f60..eea0cffa 100644 --- a/src/workflow/install-certificate/ArcanistInstallCertificateWorkflow.php +++ b/src/workflow/install-certificate/ArcanistInstallCertificateWorkflow.php @@ -132,18 +132,12 @@ EOTEXT } else if (count($uri) == 1) { $uri = reset($uri); } else { - $working_copy = ArcanistWorkingCopyIdentity::newFromPath( - $this->getWorkingDirectory()); - if (!$working_copy->getProjectRoot()) { + $conduit_uri = $this->getConduitURI(); + if (!$conduit_uri) { throw new ArcanistUsageException( "Specify an explicit URI or run this command from within a project ". "which is configured with a .arcconfig."); } - $conduit_uri = $working_copy->getConduitURI(); - if (!$conduit_uri) { - throw new ArcanistUsageException( - "This project's .arcconfig does not specify a Conduit URI."); - } $uri = $conduit_uri; } diff --git a/src/workflow/install-certificate/__init__.php b/src/workflow/install-certificate/__init__.php index f6b42a3f..ad6ca17e 100644 --- a/src/workflow/install-certificate/__init__.php +++ b/src/workflow/install-certificate/__init__.php @@ -8,7 +8,6 @@ phutil_require_module('arcanist', 'exception/usage'); phutil_require_module('arcanist', 'workflow/base'); -phutil_require_module('arcanist', 'workingcopyidentity'); phutil_require_module('phutil', 'conduit/client'); phutil_require_module('phutil', 'console'); -- 2.43.0