Commit af0d488
committed
fix(size): display results even when listing errors occur
Previously, any error during directory enumeration (e.g., a subdirectory
being deleted mid-operation) would cause the size command to exit without
displaying results, even though partial counts were successfully computed.
Remove the early return on error and ensure results are always printed
before returning. The error is still returned for proper exit code
handling, so scripts checking exit status continue to work correctly.
For JSON output, if both Count and JSON encoding fail, the Count error
takes priority as it's more meaningful to the user.
Signed-off-by: Anagh Kumar Baranwal <[email protected]>1 parent 5c53b97 commit af0d488
1 file changed
+7
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
| 61 | + | |
64 | 62 | | |
65 | 63 | | |
66 | 64 | | |
67 | 65 | | |
68 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
81 | | - | |
| 83 | + | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
0 commit comments