Skip to content

Commit dc32686

Browse files
authored
Skip errors when copying files during build (#176)
* skip copy errors * Fix styling --------- Co-authored-by: gwleuverink <[email protected]>
1 parent 1d237a1 commit dc32686

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Traits/CopiesToBuildDirectory.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
use RecursiveDirectoryIterator;
1414
use RecursiveIteratorIterator;
1515
use Symfony\Component\Filesystem\Filesystem;
16+
use Throwable;
17+
18+
use function Laravel\Prompts\warning;
1619

1720
trait CopiesToBuildDirectory
1821
{
@@ -98,7 +101,11 @@ public function copyToBuildDirectory()
98101
continue;
99102
}
100103

101-
copy($item->getPathname(), $target);
104+
try {
105+
copy($item->getPathname(), $target);
106+
} catch (Throwable $e) {
107+
warning('[WARNING] '.$e->getMessage());
108+
}
102109
}
103110

104111
$this->keepRequiredDirectories();

0 commit comments

Comments
 (0)