FIX: fix template installation

This commit is contained in:
Michal Kváček
2016-10-02 14:31:24 +02:00
parent 0482121441
commit 0ace8c9cb6
2 changed files with 7 additions and 11 deletions
+5 -10
View File
@@ -45,9 +45,9 @@ class SetTemplate extends Command
$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]);
}
} }
} }
+1
View File
@@ -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