aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLibravatar Bennett <hello@vantezzen.io>2019-12-11 11:35:01 +0100
committerLibravatar Bennett <hello@vantezzen.io>2019-12-11 11:35:01 +0100
commited062ec2d693e6f35c2357f8d9a385bf0a9a2d2d (patch)
treea1d164513ec6f4f5839756dba686f57da7bcd582 /scripts
parentAdd update script (diff)
downloadferdium-recipes-ed062ec2d693e6f35c2357f8d9a385bf0a9a2d2d.tar.gz
ferdium-recipes-ed062ec2d693e6f35c2357f8d9a385bf0a9a2d2d.tar.zst
ferdium-recipes-ed062ec2d693e6f35c2357f8d9a385bf0a9a2d2d.zip
Fix update error
Diffstat (limited to 'scripts')
-rw-r--r--scripts/update.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/update.js b/scripts/update.js
index 802cd64..c48c67c 100644
--- a/scripts/update.js
+++ b/scripts/update.js
@@ -10,7 +10,7 @@ const semver = require('semver');
10console.log("Ferdi Recipe Repository Updater v1.0.0"); 10console.log("Ferdi Recipe Repository Updater v1.0.0");
11 11
12// Server to update from 12// Server to update from
13const server = "http://api.franzinfra.com/v1/"; 13const server = "http://api.franzinfra.com/v1";
14 14
15// Create paths to important files 15// Create paths to important files
16const allJson = path.join('../', 'all.json'); 16const allJson = path.join('../', 'all.json');
@@ -48,7 +48,7 @@ const decompress = (src, dest) => {
48// Let us work in an async environment 48// Let us work in an async environment
49(async () => { 49(async () => {
50 // Get current recipes from server 50 // Get current recipes from server
51 const serverRecipes = await (await fetch(server + 'recipes')).json(); 51 const serverRecipes = await (await fetch(server + '/recipes')).json();
52 52
53 // Get current local recipes 53 // Get current local recipes
54 const localRecipes = await fs.readJson(allJson); 54 const localRecipes = await fs.readJson(allJson);
@@ -66,6 +66,7 @@ const decompress = (src, dest) => {
66 66
67 // Download recipe to filesystem 67 // Download recipe to filesystem
68 try { 68 try {
69 console.log("Downloading " + server + '/recipes/download/' + recipe.id);
69 await downloadFile( 70 await downloadFile(
70 server + '/recipes/download/' + recipe.id, 71 server + '/recipes/download/' + recipe.id,
71 compressed 72 compressed