File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,13 @@ class SqlFormatterCli {
1414 constructor ( ) {
1515 this . parser = this . getParser ( ) ;
1616 this . args = this . parser . parse_args ( ) ;
17- this . cfg = this . readConfig ( ) ;
17+ }
1818
19- this . getInput ( ) . then ( input => {
20- this . query = input ;
21- const formattedQuery = format ( this . query , this . cfg ) . trim ( ) + '\n' ;
22- this . writeOutput ( this . getOutputFile ( this . args ) , formattedQuery ) ;
23- } ) ;
19+ async run ( ) {
20+ this . cfg = this . readConfig ( ) ;
21+ this . query = await this . getInput ( ) ;
22+ const formattedQuery = format ( this . query , this . cfg ) . trim ( ) + '\n' ;
23+ this . writeOutput ( this . getOutputFile ( this . args ) , formattedQuery ) ;
2424 }
2525
2626 getParser ( ) {
@@ -150,4 +150,5 @@ class SqlFormatterCli {
150150 }
151151}
152152
153- new SqlFormatterCli ( ) ;
153+ const cli = new SqlFormatterCli ( ) ;
154+ cli . run ( ) ;
You can’t perform that action at this time.
0 commit comments