Skip to content

Commit d1d72df

Browse files
authored
fix(修复下载插件失败): 修复下载插件时,因space字段重叠拼接导致插件识别错误 (#122)
1 parent b033e4b commit d1d72df

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/Command/DownloadCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ class DownloadCommand extends AbstractCommand
2727
public function __invoke(): int
2828
{
2929
$identifier = $this->input->getArgument('identifier');
30-
[$space, $identifier] = explode('/', $identifier);
3130
$version = $this->input->getArgument('version');
3231
$appStoreService = ApplicationContext::getContainer()->get(AppStoreService::class);
33-
$appStoreService->download($space, $identifier, $version);
32+
$appStoreService->download($identifier, $version);
3433
$this->output->success('Plugin Downloaded Successfully');
3534
return AbstractCommand::SUCCESS;
3635
}

src/Service/AppStoreService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function request(string $uri, array $data = []): array;
2525
/**
2626
* Download the specified plug-in to a local directory.
2727
*/
28-
public function download(string $space, string $identifier, string $version): bool;
28+
public function download(string $identifier, string $version): bool;
2929

3030
/**
3131
* Get the details of the specified plugin.

src/Service/Impl/AppStoreServiceImpl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ public function getOtherApp(string $username): array
9292
/**
9393
* Download the specified plug-in to a local directory.
9494
*/
95-
public function download(string $space, string $identifier, string $version): bool
95+
public function download(string $identifier, string $version): bool
9696
{
9797
$localPluginPath = Plugin::PLUGIN_PATH . DIRECTORY_SEPARATOR . $identifier;
9898
if (file_exists($localPluginPath)) {
9999
throw new \RuntimeException(sprintf('The plugin %s already exists', $identifier));
100100
}
101101

102102
$originData = $this->request(__FUNCTION__, [
103-
'identifier' => $space . '/' . $identifier,
103+
'identifier' => $identifier,
104104
'version' => $version,
105105
]);
106106
$downloadResponse = Collection::make($originData);

0 commit comments

Comments
 (0)