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');
9
9
const grammarsPath = path . resolve ( __dirname , '../src/grammar' ) ;
10
10
const outputPath = path . resolve ( __dirname , '../src/lib' ) ;
11
11
12
- const languageEntries = fs . readdirSync ( grammarsPath ) ;
12
+ const languageEntries = fs . readdirSync ( grammarsPath ) . filter ( ( language ) => {
13
+ return fs . statSync ( path . join ( grammarsPath , language ) ) . isDirectory ( ) ;
14
+ } ) ;
13
15
14
16
const baseCmd = 'antlr4ng -Dlanguage=TypeScript -visitor -listener -Xexact-output-dir -o' ;
15
17
@@ -65,7 +67,7 @@ function main() {
65
67
languageEntries . forEach ( ( language ) => {
66
68
compile ( language ) ;
67
69
} ) ;
68
- } else if ( argv . lang ) {
70
+ } else if ( argv . lang && typeof argv . lang === 'string' ) {
69
71
// compile single: yarn antlr4 --lang=mysql
70
72
const supportedLanguage = languageEntries . find ( ( language ) =>
71
73
language . startsWith ( argv . lang )
You can’t perform that action at this time.
0 commit comments