Skip to content

Commit

Permalink
feat(File): fixing an issue where File::size() wouldn't retrieve the …
Browse files Browse the repository at this point in the history
…file size correctly in bundle mode.
  • Loading branch information
razshare committed Oct 28, 2024
1 parent bd9bd8a commit 5c106c1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/lib/Core/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@
* @return Result<int>
*/
public static function size(string $fileName):Result {
$size = filesize($fileName);
if (false === $size) {
return error("Could not retrieve size of file $fileName.");
try {
return ok(getSize($fileName));
} catch(Throwable $error) {
return error("Could not retrieve size of file `$fileName`. $error");
}

return ok($size);
}

/**
Expand Down

0 comments on commit 5c106c1

Please sign in to comment.