From 5e02d9d0aa6392c1e6a97d28c23a0ef1740e161d Mon Sep 17 00:00:00 2001 From: kaidesu Date: Mon, 6 Jul 2015 10:51:12 -0700 Subject: [PATCH] Ignore non-existant modules directory --- .../Modules/Repositories/Repository.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Caffeinated/Modules/Repositories/Repository.php b/src/Caffeinated/Modules/Repositories/Repository.php index 1f0c744f..5fddb0f5 100644 --- a/src/Caffeinated/Modules/Repositories/Repository.php +++ b/src/Caffeinated/Modules/Repositories/Repository.php @@ -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()); + } } /**