File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 22
33## Unreleased Changes
44
5+ - Fixed usage percentage to no longer be printed when no budget is set
6+
57## 0.10.0
68
79### Tools
Original file line number Diff line number Diff line change @@ -669,9 +669,17 @@ const main = async () => {
669669
670670 // Show budget status if available
671671 if ( response . budgetState ) {
672- const usagePercentage =
673- ( response . budgetState . totalBytesScanned / response . budgetState . budgetLimitBytes ) * 100 ;
674- result += ` (Session total: ${ ( response . budgetState . totalBytesScanned / ( 1000 * 1000 * 1000 ) ) . toFixed ( 2 ) } GB / ${ response . budgetState . budgetLimitGB } GB budget, ${ usagePercentage . toFixed ( 1 ) } % used)` ;
672+ const scannedGB = ( response . budgetState . totalBytesScanned / ( 1000 * 1000 * 1000 ) ) . toFixed ( 2 ) ;
673+
674+ if ( response . budgetState . budgetLimitGB > 0 ) {
675+ const usagePercentage = (
676+ ( response . budgetState . totalBytesScanned / response . budgetState . budgetLimitBytes ) *
677+ 100
678+ ) . toFixed ( 1 ) ;
679+ result += ` (Session total: ${ scannedGB } GB / ${ response . budgetState . budgetLimitGB } GB budget, ${ usagePercentage } % used)` ;
680+ } else {
681+ result += ` (Session total: ${ scannedGB } GB)` ;
682+ }
675683 }
676684 result += '\n' ;
677685
You can’t perform that action at this time.
0 commit comments