FIX: minor fixes in installation

This commit is contained in:
Michal Kváček
2016-09-20 23:25:45 +02:00
parent 67cd7fb36f
commit 01a28fc65a
4 changed files with 19 additions and 12 deletions
+11 -7
View File
@@ -12,7 +12,7 @@ class SetTemplate extends Command
* The name and signature of the console command. * The name and signature of the console command.
* @var string * @var string
*/ */
protected $signature = 'template:set {template}'; protected $signature = 'template:set {template} {publish?}';
/** /**
* The console command description. * The console command description.
* @var string * @var string
@@ -26,6 +26,7 @@ class SetTemplate extends Command
public function handle() public function handle()
{ {
$template = $this->argument('template'); $template = $this->argument('template');
$publish = $this->argument('publish') !== 'no-publish';
$templatePath = app_path('../templates/' . $template); $templatePath = app_path('../templates/' . $template);
if (!is_dir($templatePath) || !file_exists($templatePath . '/config.php')) { if (!is_dir($templatePath) || !file_exists($templatePath . '/config.php')) {
@@ -64,11 +65,14 @@ class SetTemplate extends Command
// theme written // theme written
$this->line('Template successfully set up.'); $this->line('Template successfully set up.');
$this->line('');
$this->line(' ** PUBLISHING ASSETS AND VIEWS **'); if ($publish) {
// publish assets and views for module and theme $this->line('');
$this->call('vendor:publish', ['--tag' => ['public-assets'], '--force' => true]); $this->line(' ** PUBLISHING ASSETS AND VIEWS **');
$this->call('vendor:publish', ['--tag' => ['module-views'], '--force' => true]); // publish assets and views for module and theme
$this->call('vendor:publish'); $this->call('vendor:publish');
$this->call('vendor:publish', ['--tag' => ['public-assets'], '--force' => true]);
$this->call('vendor:publish', ['--tag' => ['module-views'], '--force' => true]);
}
} }
} }
+3
View File
@@ -115,6 +115,9 @@ class Module extends Model
*/ */
private function deleteDirectory($directory) private function deleteDirectory($directory)
{ {
if (!is_dir($directory))
return;
$success = \File::deleteDirectory($directory, true); $success = \File::deleteDirectory($directory, true);
if (!$success) { if (!$success) {
+5 -5
View File
@@ -207,8 +207,8 @@ if [ ! -e $DB_INITIALIZED_FILE ]; then
composer install composer install
fi fi
php artisan migrate && php artisan migrate --force -n &&
php artisan db:seed && php artisan db:seed --force -n &&
touch $DB_INITIALIZED_FILE touch $DB_INITIALIZED_FILE
if [ ! $? -eq 0 ]; then if [ ! $? -eq 0 ]; then
@@ -246,11 +246,11 @@ if [ ! -e $THEME_SET_FILE ]; then
done done
# setup theme # 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
# php artisan vendor:publish --tag=module-views --force -n
# php artisan vendor:publish --tag=public-assets --force -n
# setup permissions on published directories # setup permissions on published directories
chmod 0777 public -R chmod 0777 public -R