Skip to content

Commit

Permalink
Merge pull request #224 from nickurt/patch-1
Browse files Browse the repository at this point in the history
Added a ModulePath folder check to be sure the directory exists ...
  • Loading branch information
kaidesu authored Aug 8, 2016
2 parents ae37fc0 + 1dddb02 commit cfe9fc1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Repositories/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ protected function getAllBasenames()
public function getManifest($slug)
{
if (! is_null($slug)) {
$module = str_slug($slug);
$path = $this->getManifestPath($module);
$path = $this->getManifestPath($slug);
$contents = $this->files->get($path);
$collection = collect(json_decode($contents, true));

Expand Down Expand Up @@ -111,15 +110,19 @@ public function setPath($path)
*/
public function getModulePath($slug)
{
$module = studly_case($slug);
$module = studly_case(str_slug($slug));

return $this->getPath()."/{$module}/";
if(\File::exists($this->getPath()."/{$module}/")) {
return $this->getPath()."/{$module}/";
}

return $this->getPath()."/{$slug}/";
}

/**
* Get path of module manifest file.
*
* @param string $module
* @param $slug
*
* @return string
*/
Expand Down

0 comments on commit cfe9fc1

Please sign in to comment.