File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,9 @@ const { cleanComment } = require('./cleanComment');
99const grammarsPath = path . resolve ( __dirname , '../src/grammar' ) ;
1010const outputPath = path . resolve ( __dirname , '../src/lib' ) ;
1111
12- const languageEntries = fs . readdirSync ( grammarsPath ) ;
12+ const languageEntries = fs . readdirSync ( grammarsPath ) . filter ( ( language ) => {
13+ return fs . statSync ( path . join ( grammarsPath , language ) ) . isDirectory ( ) ;
14+ } ) ;
1315
1416const baseCmd = 'antlr4ng -Dlanguage=TypeScript -visitor -listener -Xexact-output-dir -o' ;
1517
@@ -65,7 +67,7 @@ function main() {
6567 languageEntries . forEach ( ( language ) => {
6668 compile ( language ) ;
6769 } ) ;
68- } else if ( argv . lang ) {
70+ } else if ( argv . lang && typeof argv . lang === 'string' ) {
6971 // compile single: yarn antlr4 --lang=mysql
7072 const supportedLanguage = languageEntries . find ( ( language ) =>
7173 language . startsWith ( argv . lang )
You can’t perform that action at this time.
0 commit comments