Skip to content

Commit c589f2a

Browse files
authored
Merge branch 'main' into feature/custom_syntax_highlighting
2 parents 85a710a + 850d52c commit c589f2a

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

.github/workflows/build.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '20.x'
19+
20+
- name: Install dependencies and build
21+
working-directory: ./web
22+
run: |
23+
npm install
24+
npm run build

web/mta_highlighting/generate-lua-tmlanguage.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@ 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
61+
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
6062
fs.writeFileSync(outputPath, JSON.stringify(baseGrammar, null, 2));
61-
63+
6264
// Create file also in public directory for clickable keywords (public/mta-keywords_linker.js)
6365
fs.copyFileSync(outputPath, publicPath);
64-
66+
6567
console.log(`Done!`);
6668
}
6769

0 commit comments

Comments
 (0)