@@ -10,7 +10,7 @@ const __dirname = path.dirname(__filename);
1010const functionsDir = path . resolve ( __dirname , '../../functions' ) ;
1111const basePath = path . resolve ( __dirname , './lua-base.tmLanguage.json' ) ;
1212const outputPath = path . resolve ( __dirname , '../src/grammars/lua-mta.tmLanguage.json' ) ;
13- const publicPath = path . resolve ( __dirname , '../public/lua-mta.tmLanguage.json' ) ;
13+ const publicPath = path . resolve ( __dirname , '../public/grammars/ lua-mta.tmLanguage.json' ) ;
1414
1515const mtaKeywords = [ 'string' , 'bool' , 'boolean' , 'number' , 'int' , 'float' , 'element' , 'player' , 'vehicle' , 'ped' , 'object' , 'building' ] ;
1616
@@ -57,11 +57,14 @@ async function generateTmLanguage() {
5757 const baseGrammar = JSON . parse ( fs . readFileSync ( basePath , 'utf-8' ) ) ;
5858 baseGrammar . patterns = [ ...patterns , ...( baseGrammar . patterns || [ ] ) ] ;
5959
60- // Ensure the directory exists
60+ // Ensure the directoroes exist
6161 fs . mkdirSync ( path . dirname ( outputPath ) , { recursive : true } ) ;
62+ fs . mkdirSync ( path . dirname ( publicPath ) , { recursive : true } ) ;
63+
64+ // Write the updated grammar to the output file
6265 fs . writeFileSync ( outputPath , JSON . stringify ( baseGrammar , null , 2 ) ) ;
6366
64- // Create file also in public directory for clickable keywords (public/mta-keywords_linker.js)
67+ // Create file also in public directory for clickable keywords
6568 fs . copyFileSync ( outputPath , publicPath ) ;
6669
6770 console . log ( `Done!` ) ;
0 commit comments