Skip to content

Commit

Permalink
Ignore non-existant modules directory
Browse files Browse the repository at this point in the history
  • Loading branch information
kaidesu committed Jul 6, 2015
1 parent f147126 commit 5e02d9d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/Caffeinated/Modules/Repositories/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,19 @@ public function __construct(Config $config, Filesystem $files)
*/
protected function getAllBasenames()
{
$path = $this->getPath();
$collection = collect($this->files->directories($path));
$path = $this->getPath();

$basenames = $collection->map(function($item, $key) {
return basename($item);
});
try {
$collection = collect($this->files->directories($path));

return $basenames;
$basenames = $collection->map(function($item, $key) {
return basename($item);
});

return $basenames;
} catch (\InvalidArgumentException $e) {
return collect(array());
}
}

/**
Expand Down

0 comments on commit 5e02d9d

Please # to comment.