Skip to content

Commit bcf9ed1

Browse files
authored
Fix vendor publish command (#40081)
1 parent 3202603 commit bcf9ed1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Illuminate/Foundation/Console/VendorPublishCommand.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Foundation\Events\VendorTagPublished;
88
use Illuminate\Support\Arr;
99
use Illuminate\Support\ServiceProvider;
10+
use Illuminate\Support\Str;
1011
use League\Flysystem\Filesystem as Flysystem;
1112
use League\Flysystem\Local\LocalFilesystemAdapter as LocalAdapter;
1213
use League\Flysystem\MountManager;
@@ -259,8 +260,10 @@ protected function publishDirectory($from, $to)
259260
protected function moveManagedFiles($manager)
260261
{
261262
foreach ($manager->listContents('from://', true) as $file) {
262-
if ($file['type'] === 'file' && (! $manager->fileExists('to://'.$file['path']) || $this->option('force'))) {
263-
$manager->write('to://'.$file['path'], $manager->read('from://'.$file['path']));
263+
$path = Str::after($file['path'], 'from://');
264+
265+
if ($file['type'] === 'file' && (! $manager->fileExists('to://'.$path) || $this->option('force'))) {
266+
$manager->write('to://'.$path, $manager->read($file['path']));
264267
}
265268
}
266269
}

0 commit comments

Comments
 (0)