FIX: fix template installation
This commit is contained in:
@@ -44,10 +44,10 @@ class SetTemplate extends Command
|
|||||||
if ($current) {
|
if ($current) {
|
||||||
$info = json_decode($current->module_settings);
|
$info = json_decode($current->module_settings);
|
||||||
|
|
||||||
$this->line('Template is already installed. Currently using template ' . trans($current->name) . ' located in /templates/' . $info->staticName.'.');
|
$this->line('Template is already installed. Currently using template ' . trans($current->name) . ' located in /templates/' . $info->staticName . '.');
|
||||||
$confirm = $this->ask('Uninstall it and install *' . trans($config['name']) . '*? All data associated with installed template will be lost! [y/n]');
|
$confirm = $this->confirm('Uninstall it and install *' . trans($config['name']) . '*? All data associated with installed template will be lost!');
|
||||||
|
|
||||||
if ($confirm === 'y') {
|
if ($confirm) {
|
||||||
$this->line('Uninstalling ' . $current->name . '.');
|
$this->line('Uninstalling ' . $current->name . '.');
|
||||||
$current->uninstall();
|
$current->uninstall();
|
||||||
} else {
|
} else {
|
||||||
@@ -66,13 +66,8 @@ class SetTemplate extends Command
|
|||||||
// theme written
|
// theme written
|
||||||
$this->line('Template successfully set up.');
|
$this->line('Template successfully set up.');
|
||||||
|
|
||||||
if ($publish) {
|
// run again artisan for publishing resources
|
||||||
$this->line('');
|
// it cannot be done using $this->call, because we need to load different template into service providers
|
||||||
$this->line(' ** PUBLISHING ASSETS AND VIEWS **');
|
exec('php artisan vendor:publish');
|
||||||
// publish assets and views for module and theme
|
|
||||||
$this->call('vendor:publish');
|
|
||||||
$this->call('vendor:publish', ['--tag' => ['public-assets'], '--force' => true]);
|
|
||||||
$this->call('vendor:publish', ['--tag' => ['module-views'], '--force' => true]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ class Module extends Model
|
|||||||
// delete everything in /resources/views/visitor
|
// delete everything in /resources/views/visitor
|
||||||
if ($this->is_template) {
|
if ($this->is_template) {
|
||||||
$this->deleteDirectory(resource_path('views/visitor'));
|
$this->deleteDirectory(resource_path('views/visitor'));
|
||||||
|
$this->deleteDirectory(resource_path('views/modules'));
|
||||||
$this->deleteDirectory(public_path('assets'));
|
$this->deleteDirectory(public_path('assets'));
|
||||||
|
|
||||||
// delete all template paths
|
// delete all template paths
|
||||||
|
|||||||
Reference in New Issue
Block a user