@@ -10,7 +10,7 @@ const __dirname = path.dirname(__filename);
10
10
const functionsDir = path . resolve ( __dirname , '../../functions' ) ;
11
11
const basePath = path . resolve ( __dirname , './lua-base.tmLanguage.json' ) ;
12
12
const 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' ) ;
14
14
15
15
const mtaKeywords = [ 'string' , 'bool' , 'boolean' , 'number' , 'int' , 'float' , 'element' , 'player' , 'vehicle' , 'ped' , 'object' , 'building' ] ;
16
16
@@ -57,11 +57,14 @@ async function generateTmLanguage() {
57
57
const baseGrammar = JSON . parse ( fs . readFileSync ( basePath , 'utf-8' ) ) ;
58
58
baseGrammar . patterns = [ ...patterns , ...( baseGrammar . patterns || [ ] ) ] ;
59
59
60
- // Ensure the directory exists
60
+ // Ensure the directoroes exist
61
61
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
62
65
fs . writeFileSync ( outputPath , JSON . stringify ( baseGrammar , null , 2 ) ) ;
63
66
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
65
68
fs . copyFileSync ( outputPath , publicPath ) ;
66
69
67
70
console . log ( `Done!` ) ;
0 commit comments