Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/AppStore/src/Command/DownloadCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ class DownloadCommand extends AbstractCommand
public function __invoke(): int
{
$identifier = $this->input->getArgument('identifier');
[$space, $identifier] = explode('/', $identifier);
$version = $this->input->getArgument('version');
$appStoreService = ApplicationContext::getContainer()->get(AppStoreService::class);
$appStoreService->download($space, $identifier, $version);
$appStoreService->download($identifier, $version);
$this->output->success('Plugin Downloaded Successfully');
return AbstractCommand::SUCCESS;
}
Expand Down
2 changes: 1 addition & 1 deletion src/AppStore/src/Service/AppStoreService.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function request(string $uri, array $data = []): array;
/**
* Download the specified plug-in to a local directory.
*/
public function download(string $space, string $identifier, string $version): bool;
public function download(string $identifier, string $version): bool;

/**
* Get the details of the specified plugin.
Expand Down
4 changes: 2 additions & 2 deletions src/AppStore/src/Service/Impl/AppStoreServiceImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ public function getOtherApp(string $username): array
/**
* Download the specified plug-in to a local directory.
*/
public function download(string $space, string $identifier, string $version): bool
public function download(string $identifier, string $version): bool
{
$localPluginPath = Plugin::PLUGIN_PATH . DIRECTORY_SEPARATOR . $identifier;
if (file_exists($localPluginPath)) {
throw new \RuntimeException(sprintf('The plugin %s already exists', $identifier));
}

$originData = $this->request(__FUNCTION__, [
'identifier' => $space . '/' . $identifier,
'identifier' => $identifier,
'version' => $version,
]);
$downloadResponse = Collection::make($originData);
Expand Down