Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diviner/workflow/DivinerGenerateWorkflow.php
| Show All 19 Lines | $this | ||||
| 'help' => pht('Path to a Diviner book configuration.'), | 'help' => pht('Path to a Diviner book configuration.'), | ||||
| ), | ), | ||||
| array( | array( | ||||
| 'name' => 'publisher', | 'name' => 'publisher', | ||||
| 'param' => 'class', | 'param' => 'class', | ||||
| 'help' => pht('Specify a subclass of %s.', 'DivinerPublisher'), | 'help' => pht('Specify a subclass of %s.', 'DivinerPublisher'), | ||||
| 'default' => 'DivinerLivePublisher', | 'default' => 'DivinerLivePublisher', | ||||
| ), | ), | ||||
| array( | |||||
| 'name' => 'repository', | |||||
| 'param' => 'callsign', | |||||
| 'help' => pht('Repository that the documentation belongs to.'), | |||||
| ), | |||||
epriestley: I think this should be in the `.book` file instead, possibly with an optional flag to override… | |||||
Not Done Inline ActionsYeah, this was just easier for to me implement for now... I was thinking that we should try to determine the repository using the following methods:
joshuaspence: Yeah, this was just easier for to me implement for now... I was thinking that we should try to… | |||||
Not Done Inline ActionsI'm actually not sure about this anymore... in D13091 I add the functionality to change the repository from the web UI, but maybe this doesn't make sense? I think that, ideally, the repository would be automatically determined from the working copy. If that doesn't work then I guess we could maybe allow the repository to be specified in the .book file. Is this sufficient? Do we need any further customizations? joshuaspence: I'm actually not sure about this anymore... in D13091 I add the functionality to change the… | |||||
| )); | )); | ||||
| } | } | ||||
| protected function getAtomCache() { | protected function getAtomCache() { | ||||
| if (!$this->atomCache) { | if (!$this->atomCache) { | ||||
| $book_root = $this->getConfig('root'); | $book_root = $this->getConfig('root'); | ||||
| $book_name = $this->getConfig('name'); | $book_name = $this->getConfig('name'); | ||||
| $cache_directory = $book_root.'/.divinercache/'.$book_name; | $cache_directory = $book_root.'/.divinercache/'.$book_name; | ||||
| ▲ Show 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | if (!$symbols) { | ||||
| throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
| pht( | pht( | ||||
| "Publisher class '%s' must be a concrete subclass of %s.", | "Publisher class '%s' must be a concrete subclass of %s.", | ||||
| $publisher_class, | $publisher_class, | ||||
| 'DivinerPublisher')); | 'DivinerPublisher')); | ||||
| } | } | ||||
| $publisher = newv($publisher_class, array()); | $publisher = newv($publisher_class, array()); | ||||
| $callsign = $args->getArg('repository'); | |||||
| $repository = null; | |||||
| if ($callsign) { | |||||
| $repository = id(new PhabricatorRepositoryQuery()) | |||||
| ->setViewer(PhabricatorUser::getOmnipotentUser()) | |||||
| ->withCallsigns(array($callsign)) | |||||
| ->executeOne(); | |||||
| if (!$repository) { | |||||
| throw new PhutilArgumentUsageException( | |||||
| pht( | |||||
| "Repository '%s' does not exist.", | |||||
| $callsign)); | |||||
| } | |||||
| $publisher->setRepositoryPHID($repository->getPHID()); | |||||
| } | |||||
| $this->publishDocumentation($args->getArg('clean'), $publisher); | $this->publishDocumentation($args->getArg('clean'), $publisher); | ||||
| } | } | ||||
| /* -( Atom Cache )--------------------------------------------------------- */ | /* -( Atom Cache )--------------------------------------------------------- */ | ||||
| private function buildAtomCache() { | private function buildAtomCache() { | ||||
| ▲ Show 20 Lines • Show All 368 Lines • Show Last 20 Lines | |||||
I think this should be in the .book file instead, possibly with an optional flag to override it. But bin/diviner generate shouldn't need flags to do the right thing, and you should theoretically be able to generate multiple books across different repositories with one command.