diff options
author | 2019-12-11 11:35:01 +0100 | |
---|---|---|
committer | 2019-12-11 11:35:01 +0100 | |
commit | ed062ec2d693e6f35c2357f8d9a385bf0a9a2d2d (patch) | |
tree | a1d164513ec6f4f5839756dba686f57da7bcd582 | |
parent | Add update script (diff) | |
download | ferdium-recipes-ed062ec2d693e6f35c2357f8d9a385bf0a9a2d2d.tar.gz ferdium-recipes-ed062ec2d693e6f35c2357f8d9a385bf0a9a2d2d.tar.zst ferdium-recipes-ed062ec2d693e6f35c2357f8d9a385bf0a9a2d2d.zip |
Fix update error
-rw-r--r-- | scripts/update.js | 5 |
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'); | |||
10 | console.log("Ferdi Recipe Repository Updater v1.0.0"); | 10 | console.log("Ferdi Recipe Repository Updater v1.0.0"); |
11 | 11 | ||
12 | // Server to update from | 12 | // Server to update from |
13 | const server = "http://api.franzinfra.com/v1/"; | 13 | const server = "http://api.franzinfra.com/v1"; |
14 | 14 | ||
15 | // Create paths to important files | 15 | // Create paths to important files |
16 | const allJson = path.join('../', 'all.json'); | 16 | const 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 |