File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ class SqlFormatterCli {
1717 }
1818
1919 async run ( ) {
20- this . cfg = this . readConfig ( ) ;
20+ this . cfg = await this . readConfig ( ) ;
2121 this . query = await this . getInput ( ) ;
2222 const formattedQuery = format ( this . query , this . cfg ) . trim ( ) + '\n' ;
2323 this . writeOutput ( this . getOutputFile ( this . args ) , formattedQuery ) ;
@@ -63,7 +63,7 @@ class SqlFormatterCli {
6363 return parser ;
6464 }
6565
66- readConfig ( ) {
66+ async readConfig ( ) {
6767 if (
6868 tty . isatty ( 0 ) &&
6969 Object . entries ( this . args ) . every ( ( [ k , v ] ) => k === 'language' || v === undefined )
@@ -74,7 +74,7 @@ class SqlFormatterCli {
7474
7575 if ( this . args . config ) {
7676 try {
77- const configFile = fs . readFileSync ( this . args . config ) ;
77+ const configFile = await this . readFile ( this . args . config ) ;
7878 const configJson = JSON . parse ( configFile ) ;
7979 return { language : this . args . language , ...configJson } ;
8080 } catch ( e ) {
You can’t perform that action at this time.
0 commit comments