Skip to content

Commit 850d52c

Browse files
Fix generate-lua-tmlanguage.js ensuring path exists before writing
1 parent 5780bd0 commit 850d52c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

web/mta_highlighting/generate-lua-tmlanguage.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ async function generateTmLanguage() {
5656
const baseGrammar = JSON.parse(fs.readFileSync(basePath, 'utf-8'));
5757
baseGrammar.patterns = [...patterns, ...(baseGrammar.patterns || [])];
5858

59+
// Ensure the directory exists
60+
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
61+
5962
fs.writeFileSync(outputPath, JSON.stringify(baseGrammar, null, 2));
6063
console.log(`Done!`);
6164
}

0 commit comments

Comments
 (0)