Browse Source

Fixes issue #5

tags/v3.1.1
Cédric Belin 1 month ago
parent
commit
e75231242c
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/Minifier.php

+ 2
- 2
src/Minifier.php View File

@@ -153,9 +153,9 @@ class Minifier extends BaseTask implements TaskInterface {
$files = [];
foreach ($this->sources as $source) {
$finder = (new Finder)->files()->followLinks();
$hasDirectory = mb_strpos($source, "/") === false && mb_strpos($source, DIRECTORY_SEPARATOR) === false;
$hasDirectorySeparator = mb_strpos($source, DIRECTORY_SEPARATOR) !== false || mb_strpos($source, "/") !== false;

$pattern = new \SplFileInfo($hasDirectory ? $source : "./$source");
$pattern = new \SplFileInfo($hasDirectorySeparator ? $source : "./$source");
if ($pattern->isDir()) $finder->in($pattern->getPathname())->name("*.php");
else $finder->in($pattern->getPath() ?: "/")->name($pattern->getBasename());



Loading…
Cancel
Save