From db0908bad8759d4dfc21c1539045a3a35a87ae94 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 23 Jun 2021 23:59:12 +0200 Subject: [PATCH] fix app setup --- Application/ApplicationManager.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Application/ApplicationManager.php b/Application/ApplicationManager.php index 02ff604f7..f8e26140a 100644 --- a/Application/ApplicationManager.php +++ b/Application/ApplicationManager.php @@ -152,14 +152,23 @@ final class ApplicationManager */ private function installTheme(string $destination, string $theme) : void { - if (\is_dir($destination . '/css')) { - Directory::delete($destination . '/css'); + if (!\is_dir($path = $destination . '/Themes/' . $theme)) { + return; } - if (\is_dir($destination . '/Themes/' . $theme . '/css')) { + $dirs = \scandir($path); + foreach ($dirs as $dir) { + if (!\is_dir($path. '/' . $dir) || $dir === '.' || $dir === '..') { + continue; + } + + if (\is_dir($destination . '/' . $dir)) { + Directory::delete($destination . '/' . $dir); + } + Directory::copy( - $destination . '/Themes/' . $theme . '/css', - $destination . '/css', + $destination . '/Themes/' . $theme . '/' . $dir, + $destination . '/' . $dir, true ); }