Skip to content

Commit

Permalink
Fixed custom pattern polling.
Browse files Browse the repository at this point in the history
Fixes #64.
  • Loading branch information
Stolz committed Mar 6, 2015
1 parent 02578de commit c7af349
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,19 @@ public function addDir($directory, $pattern = null)
$this->css = array_unique(array_merge($this->css, $files));

// Unknown pattern. We must poll to know the asset type :(
else foreach($files as $asset)
$this->add($asset);
else
{
foreach($files as $asset)
{
if(preg_match($this->js_regex, $asset))
$this->js[] = $asset;

elseif(preg_match($this->css_regex, $asset))
$this->css[] = $asset;
}
$this->js = array_unique($this->js);
$this->css = array_unique($this->css);
}

return $this;
}
Expand Down

0 comments on commit c7af349

Please sign in to comment.