File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -17,18 +17,20 @@ public static function copy(Event $event)
1717 $ extras = $ event ->getComposer ()->getPackage ()->getExtra ();
1818 $ extraField = $ event ->isDevMode () && isset ($ extras ['copy-file-dev ' ]) ? 'copy-file-dev ' : 'copy-file ' ;
1919
20+ $ io = $ event ->getIO ();
2021 if (!isset ($ extras [$ extraField ])) {
21- throw new \InvalidArgumentException ('The dirs or files needs to be configured through the extra.copy-file setting. ' );
22+ $ io ->write ("No dirs or files are configured through the extra. {$ extraField } setting. " );
23+ return ;
2224 }
2325
2426 $ files = $ extras [$ extraField ];
2527
2628 if ($ files === array_values ($ files )) {
27- throw new \InvalidArgumentException ('The extra.copy-file must be hash like "{<dir_or_file_from>: <dir_to>}". ' );
29+ $ io ->write ("The extra. {$ extraField } must be hash like \"\{<dir_or_file_from>: <dir_to>\} \". " );
30+ return ;
2831 }
2932
3033 $ fs = new Filesystem ;
31- $ io = $ event ->getIO ();
3234
3335 foreach ($ files as $ from => $ to ) {
3436 // check pattern
@@ -42,7 +44,7 @@ public static function copy(Event $event)
4244 if (!$ overwriteNewerFiles ) {
4345 $ to = substr ($ to , 0 , -1 );
4446 }
45-
47+
4648 // Check the renaming of file for direct moving (file-to-file)
4749 $ isRenameFile = substr ($ to , -1 ) != '/ ' && !is_dir ($ from );
4850
You can’t perform that action at this time.
0 commit comments