Skip to content

Commit ab96474

Browse files
committed
don't try to set ACL on directory if filesystem doesn't support directories
1 parent bb74261 commit ab96474

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/LfmStorageRepository.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ public function makeDirectory()
5757
{
5858
$this->disk->makeDirectory($this->path, ...func_get_args());
5959

60-
$this->disk->setVisibility($this->path, 'public');
60+
// some filesystems (e.g. Google Storage, S3?) don't let you set ACLs on directories (because they don't exist)
61+
// https://cloud.google.com/storage/docs/naming#object-considerations
62+
if ($this->disk->has($this->path)) {
63+
$this->disk->setVisibility($this->path, 'public');
64+
}
6165
}
6266

6367
public function extension()

0 commit comments

Comments
 (0)