diff --git a/app/Console/Commands/SetTemplate.php b/app/Console/Commands/SetTemplate.php index e7ec4320..22901daa 100644 --- a/app/Console/Commands/SetTemplate.php +++ b/app/Console/Commands/SetTemplate.php @@ -12,7 +12,7 @@ class SetTemplate extends Command * The name and signature of the console command. * @var string */ - protected $signature = 'template:set {template}'; + protected $signature = 'template:set {template} {publish?}'; /** * The console command description. * @var string @@ -26,6 +26,7 @@ class SetTemplate extends Command public function handle() { $template = $this->argument('template'); + $publish = $this->argument('publish') !== 'no-publish'; $templatePath = app_path('../templates/' . $template); if (!is_dir($templatePath) || !file_exists($templatePath . '/config.php')) { @@ -64,11 +65,14 @@ class SetTemplate extends Command // theme written $this->line('Template successfully set up.'); - $this->line(''); - $this->line(' ** PUBLISHING ASSETS AND VIEWS **'); - // publish assets and views for module and theme - $this->call('vendor:publish', ['--tag' => ['public-assets'], '--force' => true]); - $this->call('vendor:publish', ['--tag' => ['module-views'], '--force' => true]); - $this->call('vendor:publish'); + + if ($publish) { + $this->line(''); + $this->line(' ** PUBLISHING ASSETS AND VIEWS **'); + // 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]); + } } } diff --git a/app/Models/Module.php b/app/Models/Module.php index 95afd209..82cd681e 100644 --- a/app/Models/Module.php +++ b/app/Models/Module.php @@ -115,6 +115,9 @@ class Module extends Model */ private function deleteDirectory($directory) { + if (!is_dir($directory)) + return; + $success = \File::deleteDirectory($directory, true); if (!$success) { diff --git a/resources/views/visitor/layout.blade.php b/resources/views/visitor/layout.blade.php deleted file mode 100644 index e69de29b..00000000 diff --git a/scripts/install.sh b/scripts/install.sh index 2efda43f..02b21f88 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -207,8 +207,8 @@ if [ ! -e $DB_INITIALIZED_FILE ]; then composer install fi - php artisan migrate && - php artisan db:seed && + php artisan migrate --force -n && + php artisan db:seed --force -n && touch $DB_INITIALIZED_FILE if [ ! $? -eq 0 ]; then @@ -246,11 +246,11 @@ if [ ! -e $THEME_SET_FILE ]; then done # setup theme - php artisan template:set $THEME_NAME + php artisan template:set $THEME_NAME no-publish - php artisan vendor:publish --tag=module-views --force -n - php artisan vendor:publish --tag=public-assets --force -n php artisan vendor:publish +# php artisan vendor:publish --tag=module-views --force -n +# php artisan vendor:publish --tag=public-assets --force -n # setup permissions on published directories chmod 0777 public -R