Skip to content

Commit 65c8831

Browse files
authored
Merge pull request #10 from RedberryProducts/feat/install-command-enhancement
Fix: Make install command self-cleaning
2 parents 9b10b5e + 0c8ed9b commit 65c8831

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Commands/InstallCommand.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Redberry\MailboxForLaravel\Commands;
44

55
use Illuminate\Console\Command;
6+
use Illuminate\Support\Facades\File;
67

78
class InstallCommand extends Command
89
{
@@ -12,6 +13,12 @@ class InstallCommand extends Command
1213

1314
public function handle(): int
1415
{
16+
$path = public_path('vendor/mailbox');
17+
18+
if (File::exists($path)) {
19+
File::deleteDirectory($path);
20+
}
21+
1522
$this->call('vendor:publish', [
1623
'--tag' => 'mailbox-assets',
1724
'--force' => (bool) $this->option('force'),

0 commit comments

Comments
 (0)