-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.js
More file actions
25 lines (21 loc) · 701 Bytes
/
build.js
File metadata and controls
25 lines (21 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const CSON = require('cson-parser');
const fileSystem = require('fs');
fileSystem.readFile('source.cson', 'utf8', build);
async function build(error, data) {
if (error) {
console.error(error);
return;
}
const parsed = CSON.parse(data);
fileSystem.writeFile('syntax-atom/grammars/skript.cson', CSON.stringify(parsed), logError);
console.log("Updated grammar for Atom.io.");
fileSystem.writeFile('syntax-vscode/syntaxes/skript.json', JSON.stringify(parsed), logError);
console.log("Updated grammar for VS Code.");
}
function logError(error) {
if (error) {
console.error(error);
return;
}
}
// console.log(cson.parse( "a: '123'"));