Skip to content

Commit

Permalink
fixes to the generate path js and package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioCasCeb committed Sep 18, 2023
1 parent 073c760 commit 28185c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions packages/web-new/external-scripts/generate-paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,15 @@ async function getExamples(){

async function writeExamplesToFile(){
const examplesData = await getExamples()
console.log(examplesData);

try {
const jsonData = JSON.stringify(examplesData, null, 2)
const filePath = "./src/examples-paths/examples-paths.json"
await fs.writeFile(filePath, jsonData, 'utf-8')
console.log("File created succesfully");
console.log("File created succesfully")

} catch (err) {
console.error("Failed to wirte JSON file: ", err);
console.error("Failed to wirte JSON file: ", err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/web-new/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "New design for the browser GUI for the Web of Things - Thing Description Playground",
"main": "index.js",
"scripts": {
"build": "webpack",
"build": "node external-scripts/generate-paths.js && webpack",
"dev": "webpack && node server/server.js",
"server": "node server/server.js",
"examples": "node external-scripts/generate-paths.js"
Expand Down

0 comments on commit 28185c2

Please sign in to comment.