Skip to content

Commit

Permalink
Merge pull request #526 from humanmade/backport-521-to-v3-branch
Browse files Browse the repository at this point in the history
[Backport v3-branch] Fix upload-directory command
  • Loading branch information
roborourke authored Jun 15, 2021
2 parents a840701 + 80926da commit 6660495
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion inc/class-wp-cli-command.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace S3_Uploads;

use Aws\Command;
use Aws\S3\Transfer;
use Exception;
use WP_CLI;
Expand Down Expand Up @@ -206,7 +207,7 @@ public function upload_directory( array $args, array $args_assoc ) {
$transfer_args = [
'concurrency' => $args_assoc['concurrency'],
'debug' => (bool) $args_assoc['verbose'],
'before' => function ( AWS\Command $command ) {
'before' => function ( Command $command ) {
if ( in_array( $command->getName(), [ 'PutObject', 'CreateMultipartUpload' ], true ) ) {
$acl = defined( 'S3_UPLOADS_OBJECT_ACL' ) ? S3_UPLOADS_OBJECT_ACL : 'public-read';
$command['ACL'] = $acl;
Expand Down

0 comments on commit 6660495

Please sign in to comment.