atomicptr / laravel-github-storage

A GitHub based filesystem for Laravel
MIT License
1 stars 0 forks source link

Unable to list files/directories when using prefix #1

Closed avramovic closed 23 hours ago

avramovic commented 3 days ago

Hello there! Nice package! I was just thinking about making one for myself, but you did it before me. I have an issue though - when I set a prefix, like this:

"github" => [
    "driver" => "github",
    "token" => "my-token",
    "username" => "avramovic",
    "repository" => "avramovic.github.io",
    "branch" => "master",
    "prefix" => "palindrom"
]

->put() and ->get() work as expected (file is written/read from "palindrom" directory), but if I try to list ->files() or ->directories() I'm getting the following error:

League\Flysystem\UnableToListContents Unable to list contents for '', shallow listing

Reason: Unable to list contents for '', deep listing

Reason: Not Found.

Do you have any idea what may be the issue here?

atomicptr commented 23 hours ago

There seems to be a problem with empty paths and prefixes and I think I found a solution that hopefully did not break anything else (tests are green...) with https://github.com/atomicptr/flysystem-github-storage/commit/f23cc5937da7b2cdac1ef187977727140c8be3fb

atomicptr commented 23 hours ago

Since this library does not require a specific version of the other one this should be fixed by just updating your dependencies, please re-open the ticket should the problem persist

In that case I might need a better example though see: https://github.com/atomicptr/flysystem-github-storage/blob/master/tests/Feature/GithubAdapterTest.php#L208