File tree Expand file tree Collapse file tree
packages/flowtest-cli/bin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,21 +93,27 @@ const argv = yargs(hideBin(process.argv))
9393 } else {
9494 console . log ( chalk . bold ( 'Flow Run: ' ) + chalk . red ( ` ✕ ` ) + chalk . dim ( result . status ) ) ;
9595 }
96- logger . add ( LogLevel . INFO , `Total time: ${ Date . now ( ) - startTime } ms` ) ;
97- console . log ( chalk . bold ( 'Total Time: ' ) + chalk . dim ( `${ Date . now ( ) - startTime } ms` ) ) ;
96+ const time = Date . now ( ) - startTime ;
97+ logger . add ( LogLevel . INFO , `Total time: ${ time } ms` ) ;
98+ console . log ( chalk . bold ( 'Total Time: ' ) + chalk . dim ( `${ time } ms` ) ) ;
9899 //console.log(logger.get());
99100
100101 if ( argv . scan ) {
101102 const data = {
102- version : 1 ,
103- name : argv . file . toString ( ) ,
104- scan : logger . get ( ) ,
103+ scan_metadata : {
104+ version : 1 ,
105+ name : argv . file . toString ( ) ,
106+ status : result . status ,
107+ time,
108+ } ,
109+ scan : bytesToBase64 ( new TextEncoder ( ) . encode ( JSON . stringify ( logger . get ( ) ) ) ) ,
105110 } ;
106111 try {
107- const response = await axiosClient . post (
108- '/upload' ,
109- bytesToBase64 ( new TextEncoder ( ) . encode ( JSON . stringify ( data ) ) ) ,
110- ) ;
112+ const response = await axiosClient . post ( '/upload' , data , {
113+ headers : {
114+ 'Content-Type' : 'application/json' ,
115+ } ,
116+ } ) ;
111117 console . log ( chalk . bold ( 'Flow Scan: ' ) + chalk . dim ( `${ baseUrl } /scan/${ response . data . data [ 0 ] . id } ` ) ) ;
112118 } catch ( error ) {
113119 if ( error ?. response ) {
You can’t perform that action at this time.
0 commit comments