File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed
Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -258,25 +258,29 @@ private function uploadArtifacts(array $config, array $packageUrls): void
258258
259259 IO ::spin ('uploading ' );
260260
261+ $ client = HttpClient::create ([
262+ 'timeout ' => 10 ,
263+ 'headers ' => [
264+ 'User-Agent ' => 'Bref CLI ' ,
265+ 'Content-Type ' => 'application/json ' ,
266+ 'Accept ' => 'application/json ' ,
267+ ],
268+ ]);
269+
261270 foreach ($ archivePaths as $ id => $ archivePath ) {
262271 $ url = $ packageUrls [$ id ];
263272
264- $ client = HttpClient::create ([
265- 'timeout ' => 10 ,
266- 'headers ' => [
267- 'User-Agent ' => 'Bref CLI ' ,
268- 'Content-Type ' => 'application/json ' ,
269- 'Accept ' => 'application/json ' ,
270- ],
271- ]);
273+ IO ::verbose (sprintf (
274+ 'Uploading %s (%d MB) ' ,
275+ $ archivePath ,
276+ round (((float ) filesize ($ archivePath )) / 1024. / 1024. , 1 )
277+ ));
272278
273279 // Note: Symfony suggests using `fopen()` to stream the content, but S3 does not
274280 // support streaming that way and throws a 501 Not Implemented exception.
275281 // Sending the entire file in one batch works fine, but this likely
276282 // creates a blocking operation for the CLI.
277283 $ client ->request ('PUT ' , $ url , ['body ' => file_get_contents ($ archivePath )]);
278-
279- IO ::verbose ("Uploading $ archivePath " );
280284 }
281285 }
282286
You can’t perform that action at this time.
0 commit comments