diff --git a/.env.example b/.env.example index 89fc49f..1f4e252 100644 --- a/.env.example +++ b/.env.example @@ -3,7 +3,6 @@ DARK_MODE=false SORT_ORDER=type REVERSE_SORT=false -HIDDEN_FILES="" HIDE_APP_FILES=true HIDE_VCS_FILES=true diff --git a/app/Bootstrap/FinderComposer.php b/app/Bootstrap/FinderComposer.php index c06f352..55cef57 100644 --- a/app/Bootstrap/FinderComposer.php +++ b/app/Bootstrap/FinderComposer.php @@ -53,7 +53,13 @@ class FinderComposer $finder = Finder::create()->followLinks(); $finder->ignoreVCS($this->config->get('app.hide_vcs_files', false)); $finder->filter(function (SplFileInfo $file) { - return ! $this->hiddenFiles()->contains($file->getRealPath()); + foreach ($this->hiddenFiles() as $hiddenPath) { + if (strpos($file->getRealPath(), $hiddenPath) === 0) { + return false; + } + } + + return true; }); $sortOrder = $this->config->get('app.sort_order', 'type'); @@ -93,6 +99,6 @@ class FinderComposer ); })->flatten()->map(function (string $file) { return realpath($file); - }); + })->unique(); } } diff --git a/app/config/app.php b/app/config/app.php index 101293b..362c65e 100644 --- a/app/config/app.php +++ b/app/config/app.php @@ -24,9 +24,9 @@ return [ * * Default value: [] */ - 'hidden_files' => array_map(function (string $file) { - return trim($file); - }, explode(',', Helpers::env('HIDDEN_FILES'))), + 'hidden_files' => [ + // ... + ], /** * Whether or not to hide application files/directories form the listing.