Skip to content

Commit 33ec37c

Browse files
authored
fix: ensure native serve resource path is cleared only if it exists (#200)
1 parent ce5e4f7 commit 33ec37c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Commands/ResetCommand.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ public function handle(): int
2020
{
2121
intro('Clearing build and dist directories...');
2222

23+
$filesystem = new Filesystem;
24+
2325
// Removing and recreating the native serve resource path
2426
$nativeServeResourcePath = realpath(__DIR__.'/../../resources/js/resources/app/');
25-
$this->line('Clearing: '.$nativeServeResourcePath);
26-
27-
$filesystem = new Filesystem;
28-
$filesystem->remove($nativeServeResourcePath);
29-
$filesystem->mkdir($nativeServeResourcePath);
27+
if ($filesystem->exists($nativeServeResourcePath)) {
28+
$this->line('Clearing: '.$nativeServeResourcePath);
29+
$filesystem->remove($nativeServeResourcePath);
30+
$filesystem->mkdir($nativeServeResourcePath);
31+
}
3032

3133
// Removing the bundling directories
3234
$bundlingPath = base_path('build/');

0 commit comments

Comments
 (0)