Skip to content

Commit 9fd8eef

Browse files
committed
Merge branch '7.x' into 8.x
2 parents c11a823 + f72b6a5 commit 9fd8eef

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

src/Foundation/Console/VendorPublishCommand.php

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,37 @@ class VendorPublishCommand extends Command
1515
#[\Override]
1616
protected function status($from, $to, $type)
1717
{
18-
$from = str_replace(package_path().'/', '', (string) realpath($from));
18+
$laravelPath = base_path();
19+
$packagePath = package_path();
1920

20-
$to = str_replace(base_path().'/', '', (string) realpath($to));
21+
$pathLocation = function ($path) use ($laravelPath, $packagePath) {
22+
$path = (string) realpath($path);
23+
24+
return match (true) {
25+
str_starts_with($path, $laravelPath) => str_replace("{$laravelPath}/", '@laravel/', $path),
26+
str_starts_with($path, $packagePath) => str_replace("{$packagePath}/", './', $path),
27+
default => $path,
28+
};
29+
};
30+
31+
$fromLocation = $pathLocation($from);
32+
$toLocation = $pathLocation($to);
33+
34+
if (
35+
$type === 'directory' &&
36+
$fromLocation === $toLocation &&
37+
is_link($to)
38+
) {
39+
$this->components->task('Synced directory');
40+
41+
return;
42+
}
2143

2244
$this->components->task(\sprintf(
2345
'Copying %s [%s] to [%s]',
2446
$type,
25-
$from,
26-
$to,
47+
$fromLocation,
48+
$toLocation,
2749
));
2850
}
2951
}

0 commit comments

Comments
 (0)