check if module exists
This commit is contained in:
parent
7dabc8a3cc
commit
ba09514278
@ -12,6 +12,7 @@ use Artisan;
|
|||||||
use Cache;
|
use Cache;
|
||||||
use Date;
|
use Date;
|
||||||
use File;
|
use File;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
use ZipArchive;
|
use ZipArchive;
|
||||||
|
|
||||||
class Updater
|
class Updater
|
||||||
@ -100,10 +101,11 @@ class Updater
|
|||||||
throw new \Exception(trans('modules.errors.file_copy', ['module' => $alias]));
|
throw new \Exception(trans('modules.errors.file_copy', ['module' => $alias]));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Get module instance
|
if ($module = Module::findByAlias($alias)) {
|
||||||
$module = module($alias);
|
|
||||||
|
|
||||||
$module_path = $module->getPath();
|
$module_path = $module->getPath();
|
||||||
|
} else {
|
||||||
|
$module_path = base_path('modules/' . Str::studly($alias));
|
||||||
|
}
|
||||||
|
|
||||||
// Create module directory
|
// Create module directory
|
||||||
if (!File::isDirectory($module_path)) {
|
if (!File::isDirectory($module_path)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user