Skip to content

Commit dc265ef

Browse files
committed
updated syntax highlighting script and added it's entry to package.json
1 parent 720a897 commit dc265ef

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"fetch-examples:prod": "cross-env NODE_ENV=production node ./dist/fetch-examples.bundle.js",
2121
"fetch-examples-gg:prod": "cross-env NODE_ENV=production node ./dist/fetch-examples-gg.bundle.js",
2222
"fetch-examples-ml5:prod": "cross-env NODE_ENV=production node ./dist/fetch-examples-ml5.bundle.js",
23+
"update-syntax-highlighting": "node ./server/scripts/update-syntax-highlighting.js",
2324
"heroku-postbuild": "touch .env; npm run build"
2425
},
2526
"husky": {

server/scripts/update-syntax-highlighting.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const fs = require('fs');
2+
const process = require('process');
23
const request = require('request');
34

45
request('https://p5js.org/reference/data.json', (err, res) => {
@@ -33,7 +34,7 @@ request('https://p5js.org/reference/data.json', (err, res) => {
3334
generatedCode += `let p5FunctionKeywords = ${p5FunctionPart}; \n`;
3435
generatedCode += 'exports.p5FunctionKeywords = p5FunctionKeywords;\n';
3536
generatedCode += 'exports.p5VariableKeywords = p5VariableKeywords;\n';
36-
fs.writeFile('../../client/utils/p5-javascript-template.js', generatedCode, (error) => {
37+
fs.writeFile(`${process.cwd()}/client/utils/p5-javascript-template.js`, generatedCode, (error) => {
3738
if (error) {
3839
console.log("Error!! Couldn't write to the file", error);
3940
} else {

0 commit comments

Comments
 (0)