File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,7 +26,9 @@ import { registerVM } from "./lib/vm.ts";
2626
2727const program = new Command ( ) ;
2828
29- await Promise . all ( [ checkVersion ( ) , getAppBanner ( ) ] ) ;
29+ if ( ! process . argv . includes ( "--json" ) ) {
30+ await Promise . all ( [ checkVersion ( ) , getAppBanner ( ) ] ) ;
31+ }
3032
3133program
3234 . name ( "sf" )
Original file line number Diff line number Diff line change @@ -47,11 +47,11 @@ export function registerContracts(program: Command) {
4747 )
4848 . description ( "List all contracts" )
4949 . action ( async ( options ) => {
50+ const contracts = await listContracts ( options . all , options . state ) ;
5051 if ( options . json ) {
51- console . log ( await listContracts ( options . all , options . state ) ) ;
52+ console . log ( JSON . stringify ( contracts , null , 2 ) ) ;
5253 } else {
53- const data = await listContracts ( options . all , options . state ) ;
54- render ( < ContractList contracts = { data } /> ) ;
54+ render ( < ContractList contracts = { contracts } /> ) ;
5555 }
5656 } ) ,
5757 ) ;
You can’t perform that action at this time.
0 commit comments