File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,14 @@ import fs from 'fs';
2
2
import path from 'path' ;
3
3
import yaml from 'js-yaml' ;
4
4
import { glob } from 'glob' ;
5
+ import { fileURLToPath } from 'url' ;
5
6
6
- const functionsDir = path . resolve ( '../../functions' ) ;
7
- const basePath = path . resolve ( './lua-base.tmLanguage.json' ) ;
8
- const outputPath = path . resolve ( '../src/grammars/lua-mta.tmLanguage.json' ) ;
7
+ const __filename = fileURLToPath ( import . meta. url ) ;
8
+ const __dirname = path . dirname ( __filename ) ;
9
+
10
+ const functionsDir = path . resolve ( __dirname , '../../functions' ) ;
11
+ const basePath = path . resolve ( __dirname , './lua-base.tmLanguage.json' ) ;
12
+ const outputPath = path . resolve ( __dirname , '../src/grammars/lua-mta.tmLanguage.json' ) ;
9
13
10
14
function extractFunctionsWithScope ( yamlContent ) {
11
15
if ( yamlContent . shared ?. name ) {
Original file line number Diff line number Diff line change 3
3
"type" : " module" ,
4
4
"version" : " 0.0.1" ,
5
5
"scripts" : {
6
+ "predev" : " node mta_highlighting/generate-lua-tmlanguage.js" ,
6
7
"dev" : " astro dev" ,
7
8
"start" : " astro dev" ,
9
+ "prebuild" : " node mta_highlighting/generate-lua-tmlanguage.js" ,
8
10
"build" : " astro build" ,
9
11
"preview" : " astro preview" ,
10
12
"astro" : " astro"
You can’t perform that action at this time.
0 commit comments