Commit 54dd1bc
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 51b197c commit 54dd1bc
1 file changed
+10
-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 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
| |||
78 | 83 | | |
79 | 84 | | |
80 | 85 | | |
81 | | - | |
| 86 | + | |
82 | 87 | | |
83 | 88 | | |
84 | 89 | | |
0 commit comments