File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
packages/cli/src/commands/billing Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -73,10 +73,18 @@ export default class BillingStatus extends Command {
7373 this . log ( `\n${ chalk . bold ( " Line Items:" ) } ` ) ;
7474 for ( const item of result . lineItems ) {
7575 const product = `${ flags . product . charAt ( 0 ) . toUpperCase ( ) } ${ flags . product . slice ( 1 ) } ` ;
76- const chain = item . description . toLowerCase ( ) . includes ( "sepolia" ) ? "Sepolia" : "Mainnet" ;
77- this . log (
78- ` • ${ product } (${ chain } ): $${ item . subtotal . toFixed ( 2 ) } (${ item . quantity } vCPU hours × $${ item . price . toFixed ( 3 ) } /vCPU hour)` ,
79- ) ;
76+ const isChainSpecific = item . description . match ( / \b ( s e p o l i a | m a i n n e t ) \b / i) ;
77+ if ( isChainSpecific ) {
78+ const chain = item . description . toLowerCase ( ) . includes ( "sepolia" ) ? "Sepolia" : "Mainnet" ;
79+ this . log (
80+ ` • ${ product } (${ chain } ): $${ item . subtotal . toFixed ( 2 ) } (${ item . quantity } vCPU hours × $${ item . price . toFixed ( 3 ) } /vCPU hour)` ,
81+ ) ;
82+ } else {
83+ const sku = item . description . split ( " " ) . slice ( - 2 ) . join ( " " ) || "Unknown" ;
84+ this . log (
85+ ` • ${ product } (${ sku } ): $${ item . subtotal . toFixed ( 2 ) } (${ item . quantity } hours × $${ item . price . toFixed ( 3 ) } /hour)` ,
86+ ) ;
87+ }
8088 }
8189 }
8290
You can’t perform that action at this time.
0 commit comments