X Tutup
Skip to content

Commit c464ff4

Browse files
authored
Merge pull request #40081 from owncloud/issue-39930
Display each app only once in app:list --minimal
2 parents efef3c8 + 8eb4d4c commit c464ff4

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

changelog/unreleased/39930

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Bugfix: List apps only once
2+
3+
`occ app:list --minimal`
4+
could display apps twice in the listing. Each app is now displayed only once.
5+
6+
https://github.com/owncloud/core/issues/39930
7+
https://github.com/owncloud/core/pull/40081

core/Command/App/ListApps.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ protected function execute(InputInterface $input, OutputInterface $output) {
122122
$appDetailRecord = [];
123123

124124
if ($minimalView) {
125-
$apps['enabled'][] = sprintf('%s%s', $app, isset($versions[$app]) ? ' '.$versions[$app] : '');
125+
$apps['enabled'][$app] = sprintf('%s%s', $app, isset($versions[$app]) ? ' '.$versions[$app] : '');
126126
continue;
127127
}
128128

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

143143
if ($minimalView) {
144-
$apps['disabled'][] = sprintf('%s%s', $app, isset($versions[$app]) ? ' '.$versions[$app] : '');
144+
$apps['disabled'][$app] = sprintf('%s%s', $app, isset($versions[$app]) ? ' '.$versions[$app] : '');
145145
continue;
146146
}
147147

@@ -154,6 +154,14 @@ protected function execute(InputInterface $input, OutputInterface $output) {
154154
}
155155
}
156156

157+
if ($minimalView) {
158+
// For minimal view we do not want writeArrayInOutputFormat to write a key-value format
159+
// The app name and version are already formatted in the string that is the array value.
160+
// So just keep the array values.
161+
$apps['enabled'] = \array_values($apps['enabled']);
162+
$apps['disabled'] = \array_values($apps['disabled']);
163+
}
164+
157165
$this->writeAppList($input, $output, $apps);
158166
return 0;
159167
}

0 commit comments

Comments
 (0)
X Tutup