X Tutup
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
7 changes: 7 additions & 0 deletions changelog/unreleased/39930
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Bugfix: List apps only once

`occ app:list --minimal`
could display apps twice in the listing. Each app is now displayed only once.

https://github.com/owncloud/core/issues/39930
https://github.com/owncloud/core/pull/40081
12 changes: 10 additions & 2 deletions core/Command/App/ListApps.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ protected function execute(InputInterface $input, OutputInterface $output) {
$appDetailRecord = [];

if ($minimalView) {
$apps['enabled'][] = sprintf('%s%s', $app, isset($versions[$app]) ? ' '.$versions[$app] : '');
$apps['enabled'][$app] = sprintf('%s%s', $app, isset($versions[$app]) ? ' '.$versions[$app] : '');
continue;
}

Expand All @@ -141,7 +141,7 @@ protected function execute(InputInterface $input, OutputInterface $output) {
$appDetailRecord = [];

if ($minimalView) {
$apps['disabled'][] = sprintf('%s%s', $app, isset($versions[$app]) ? ' '.$versions[$app] : '');
$apps['disabled'][$app] = sprintf('%s%s', $app, isset($versions[$app]) ? ' '.$versions[$app] : '');
continue;
}

Expand All @@ -154,6 +154,14 @@ protected function execute(InputInterface $input, OutputInterface $output) {
}
}

if ($minimalView) {
// For minimal view we do not want writeArrayInOutputFormat to write a key-value format
// The app name and version are already formatted in the string that is the array value.
// So just keep the array values.
$apps['enabled'] = \array_values($apps['enabled']);
$apps['disabled'] = \array_values($apps['disabled']);
}

$this->writeAppList($input, $output, $apps);
return 0;
}
Expand Down
X Tutup