Fix prune command failing on subdirectories #274

Merged
pxlrbt merged 1 commit from fix/prune-directory-type-error into main 2026-08-15 10:50:50 +00:00
pxlrbt commented 2026-08-15 10:48:31 +00:00 (Migrated from github.com)

Closes #264

listContents() yields DirectoryAttributes for subdirectories, not just FileAttributes (see flysystem-local/LocalFilesystemAdapter.php:230). The closure's FileAttributes typehint therefore threw a TypeError before the $file->type() === 'file' guard inside the closure could run — so filament-excel:prune exited with code 1 as soon as storage/app/filament-excel/ contained any directory (e.g. from withFilename('subdir/name')).

  • Typehint StorageAttributes and filter with isFile().
  • List recursively, so exports stored in subdirectories actually get pruned.
Closes #264 `listContents()` yields `DirectoryAttributes` for subdirectories, not just `FileAttributes` (see `flysystem-local/LocalFilesystemAdapter.php:230`). The closure's `FileAttributes` typehint therefore threw a `TypeError` before the `$file->type() === 'file'` guard inside the closure could run — so `filament-excel:prune` exited with code 1 as soon as `storage/app/filament-excel/` contained any directory (e.g. from `withFilename('subdir/name')`). - Typehint `StorageAttributes` and filter with `isFile()`. - List recursively, so exports stored in subdirectories actually get pruned.
Sign in to join this conversation.
No description provided.