File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -42,15 +42,13 @@ export default class Avro extends Command {
4242 if ( ! flags . file )
4343 Logger . error ( this , 'Input file is not provided' )
4444
45- if ( args . command )
46- args . command = args . command
47- else
45+ if ( flags . command ) // if -c flag have value, then override
4846 args . command = flags . command
4947
5048 if ( ! args . command )
5149 Logger . error ( this , 'Command is empty or not provided, supported:' + Avro . SupportedCommands )
5250 else // if exists then make Lower Case
53- args . command = args . command . toLowerCase ( )
51+ args . command = args . command . toLowerCase ( )
5452
5553 // output is not mendatory for 'get_schema' command
5654 if ( args . command !== Avro . GET_SCHEMA && ! flags . output )
@@ -116,15 +114,15 @@ export default class Avro extends Command {
116114 let prependHeader = true // only write on the first line
117115 avro . createFileDecoder ( flags . file )
118116 . on ( 'data' , function ( recordStr ) {
119- // @ts -ignore
117+ // @ts -ignore
120118 let json = JSON . parse ( JSON . stringify ( recordStr ) )
121119 Json2Csv . json2csv ( json , ( err ?: Error , csv ?: string ) => {
122120 if ( csv ) {
123- // @ts -ignore
121+ // @ts -ignore
124122 Utilities . appendStringToFile ( this , flags . output , csv + '\n' )
125123 }
126124 if ( err ) {
127- // @ts -ignore
125+ // @ts -ignore
128126 Logger . error ( this , err . toString ( ) )
129127 }
130128 } , { prependHeader} )
You can’t perform that action at this time.
0 commit comments