Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Aug 15, 2023
1 parent 95b5b08 commit 4cf43a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/Listeners/AddAssetSymlinkFolders.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public function handle(ServeCommandStarted $event): void
return ['from' => $from, 'to' => $to];
})->filter()
->each(function ($pair) {
/** @var array{from: string, to: string} $pair */

/** @var string $from */
$from = $pair['from'];

Expand All @@ -66,7 +68,6 @@ public function handle(ServeCommandStarted $event): void
$this->files->ensureDirectoryExists($rootDirectory);
}

/** @phpstan-ignore-next-line */
$this->files->link($from, $to);
});
}
Expand Down
12 changes: 4 additions & 8 deletions src/Listeners/RemoveAssetSymlinkFolders.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,11 @@ public function handle(ServeCommandEnded $event): void
/** @var string $to */
$to = Workbench::laravelPath($pair['to']);

if (! is_link($to)) {
return null;
}

return $to;
return is_link($to) ? $to : null;
})->filter()
->each(function ($linkPath) {
/** @phpstan-ignore-next-line */
$this->files->delete($linkPath);
->each(function ($to) {
/** @var string $to */
$this->files->delete($to);
});
}
}

0 comments on commit 4cf43a8

Please sign in to comment.