From 17ecedf846555ba40f7481d730d014034dd058b2 Mon Sep 17 00:00:00 2001 From: Daniel Cintra Date: Thu, 5 Sep 2024 21:09:30 -0300 Subject: [PATCH] Add conditional check for artisan command. --- src/Console/InstallCommand.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Console/InstallCommand.php b/src/Console/InstallCommand.php index ca3a2dd..b92b2f3 100644 --- a/src/Console/InstallCommand.php +++ b/src/Console/InstallCommand.php @@ -22,7 +22,9 @@ public function handle(): void $this->copyResourcesComponentsFiles(); $this->copyTranslationFile(); - $this->call('storage:link'); + if (!is_link(public_path('storage'))) { + $this->call('storage:link'); + } $this->call('modular:blog-migrate'); @@ -45,7 +47,7 @@ private function copyBlogModuleDirectory(): void { $this->info('Copying Blog Module directory...'); (new Filesystem)->ensureDirectoryExists(base_path('modules')); - (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/modules/Blog', base_path('modules/Blog')); + (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/modules/Blog', base_path('modules/Blog')); $this->info('Blog Module directory copied successfully.'); } @@ -53,7 +55,7 @@ private function copyResourcesComponentsFiles(): void { $this->info('Copying Blog Module components...'); (new Filesystem)->ensureDirectoryExists(resource_path('js/Components/Modules/Blog')); - (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/resources/js/Components/Modules/Blog', resource_path('js/Components/Modules/Blog')); + (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/resources/js/Components/Modules/Blog', resource_path('js/Components/Modules/Blog')); $this->info('Blog Module components copied successfully.'); } @@ -61,7 +63,7 @@ private function copyBlogSeederImages(): void { $this->info('Copying Blog Seeder images...'); (new Filesystem)->ensureDirectoryExists(resource_path('images/blog')); - (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/resources/images/blog', resource_path('images/blog')); + (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/resources/images/blog', resource_path('images/blog')); $this->info('Blog Module Seeder images copied successfully.'); } @@ -69,7 +71,7 @@ private function copyResourcesFiles(): void { $this->info('Copying Blog Module resources...'); (new Filesystem)->ensureDirectoryExists(resource_path('js/Pages')); - (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/resources/js/Pages', resource_path('js/Pages')); + (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/resources/js/Pages', resource_path('js/Pages')); $this->info('Blog Module resources copied successfully.'); } @@ -77,7 +79,7 @@ private function copyResourcesSiteFiles(): void { $this->info('Copying Blog Module resources-site...'); (new Filesystem)->ensureDirectoryExists(base_path('resources-site')); - (new Filesystem)->copyDirectory(__DIR__.'/../../stubs/resources-site', base_path('resources-site')); + (new Filesystem)->copyDirectory(__DIR__ . '/../../stubs/resources-site', base_path('resources-site')); $this->info('Blog Module resources-site copied successfully.'); } @@ -87,7 +89,7 @@ private function copyTranslationFile(): void if (! file_exists($paginationEnglish)) { (new Filesystem)->ensureDirectoryExists(base_path('lang/en')); - copy(__DIR__.'/../../stubs/lang/en/pagination.php', base_path('lang/en/pagination.php')); + copy(__DIR__ . '/../../stubs/lang/en/pagination.php', base_path('lang/en/pagination.php')); } } }