From 289b75a171591066f2b9e0cf3267eaca3de5898d Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Mon, 23 Dec 2024 07:08:37 +0800 Subject: [PATCH] [7.x] Use `realpath()` on `vendor:publish` output (#284) Signed-off-by: Mior Muhammad Zaki --- src/Foundation/Console/VendorPublishCommand.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Foundation/Console/VendorPublishCommand.php b/src/Foundation/Console/VendorPublishCommand.php index 51eaa5b5..377b5ec3 100644 --- a/src/Foundation/Console/VendorPublishCommand.php +++ b/src/Foundation/Console/VendorPublishCommand.php @@ -16,8 +16,17 @@ class VendorPublishCommand extends Command protected function status($from, $to, $type) { $format = function ($path) use ($type) { + if ($type === 'directory' && is_link($path)) { + return $path; + } + + $realpath = realpath($path); + + if ($realpath !== false) { + $path = $realpath; + } + return match (true) { - $type === 'directory' && is_link($path) => $path, $this->files->exists($path) => $path, default => (string) realpath($path), };