Skip to content

Commit c74bdd6

Browse files
kyteinskybackportbot[bot]
authored andcommitted
address review comments
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
1 parent 3e687e0 commit c74bdd6

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

lib/Fetcher/ExAppArchiveFetcher.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,11 @@ public function installTranslations(string $appId, string $dirTranslations): str
9696

9797
public function getExAppFolder(string $appId): ?string {
9898
$appsPaths = $this->config->getSystemValue('apps_paths', []);
99-
$existingPath = '';
100-
foreach ($appsPaths as $appPath) {
101-
if ($appPath['writable'] && file_exists($appPath['path'] . '/' . $appId)) {
102-
$existingPath = $appPath['path'] . '/' . $appId;
103-
}
104-
}
105-
if (!empty($existingPath)) {
106-
return $existingPath;
107-
}
10899
foreach ($appsPaths as $appPath) {
109100
if ($appPath['writable']) {
110-
if (mkdir($appPath['path'] . '/' . $appId)) {
111-
return $appPath['path'] . '/' . $appId;
101+
$fullAppPath = $appPath['path'] . '/' . $appId;
102+
if (is_dir($fullAppPath) || mkdir($fullAppPath)) {
103+
return $fullAppPath;
112104
}
113105
}
114106
}
@@ -131,7 +123,7 @@ public function removeExAppFolder(string $appId): void {
131123
return;
132124
}
133125
foreach ($appsPaths as $appPath) {
134-
if ($appPath['writable'] && file_exists($appPath['path'] . '/' . $appId)) {
126+
if ($appPath['writable'] && is_dir($appPath['path'] . '/' . $appId)) {
135127
$this->rmdirr($appPath['path'] . '/' . $appId);
136128
}
137129
}

0 commit comments

Comments
 (0)