Skip to content

Commit

Permalink
Everything is better with glob()
Browse files Browse the repository at this point in the history
Now you may use file pattern in `$this->taskConcat()`. For example:
```
$this->taskConcat([
'./public/angular/app/controllers/*',
'./public/angular/app/directives/*'
])
```
  • Loading branch information
slider23 committed May 26, 2014
1 parent ec935bc commit 04ad07e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/Task/Concat.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,15 @@ public function run()

$dump = '';

foreach ($this->files as $file) {
if (!file_exists($file)) {
return Result::error($this, sprintf('File %s not found', $file));
}

$dump .= file_get_contents($file);
}
foreach ($this->files as $path) {
foreach(glob($path) as $file) {
if(!file_exists($file)) {
return Result::error($this, sprintf('File %s not found', $file));
}

$dump .= file_get_contents($file);
}
}

$this->printTaskInfo(sprintf('Writing <info>%s</info>', $this->dst));

Expand Down

0 comments on commit 04ad07e

Please sign in to comment.