@@ -32,23 +32,16 @@ public function __invoke(array $configuration): Configurator\SatelliteBuilderInt
3232 if (isset ($ configuration ['docker ' ]['tags ' ])) {
3333 $ builder ->withTags (...$ configuration ['docker ' ]['tags ' ]);
3434 }
35-
36- if (isset ($ configuration ['docker ' ]['include ' ]) && is_iterable ($ configuration ['docker ' ]['include ' ])) {
37- foreach ($ configuration ['docker ' ]['include ' ] as $ path ) {
38- if (is_dir ($ path )) {
39- $ builder ->withDirectory (new Packaging \Directory ($ path ));
40- } else {
41- $ builder ->withFile (new Packaging \Asset \LocalFile ($ path ));
35+ if (isset ($ configuration ['docker ' ]['copy ' ])) {
36+ foreach ($ configuration ['docker ' ]['copy ' ] as $ copy ) {
37+ if (!file_exists ($ copy ['from ' ])) {
38+ throw new FileOrDirectoryNotFoundException (strtr ('Unable to find the file or the directory at path %path% ' , ['path ' => $ copy ['from ' ]]));
4239 }
43- }
44- }
4540
46- if (isset ($ configuration ['include ' ])) {
47- foreach ($ configuration ['include ' ] as $ path ) {
48- if (is_dir ($ path )) {
49- $ builder ->withDirectory (new Packaging \Directory ($ path ));
41+ if (is_file ($ copy ['from ' ])) {
42+ $ builder ->withFile (new Packaging \File ($ copy ['from ' ], new Packaging \Asset \LocalFile ($ copy ['from ' ])), $ copy ['to ' ]);
5043 } else {
51- $ builder ->withFile (new Packaging \Asset \ LocalFile ( $ path ) );
44+ $ builder ->withDirectory (new Packaging \Directory ( $ copy [ ' from ' ]), $ copy [ ' to ' ] );
5245 }
5346 }
5447 }
@@ -60,6 +53,9 @@ public function __invoke(array $configuration): Configurator\SatelliteBuilderInt
6053 } else {
6154 $ builder ->withComposerFile (new Packaging \Asset \LocalFile ('composer.json ' ));
6255 }
56+ if (file_exists ('vendor ' )) {
57+ $ builder ->withDirectory (new Packaging \Directory ('vendor/ ' ));
58+ }
6359 }
6460
6561 if (\array_key_exists ('autoload ' , $ configuration ['composer ' ]) && \array_key_exists ('psr4 ' , $ configuration ['composer ' ]['autoload ' ])) {
0 commit comments