From 1599c88eca426a275adc2884d08a0ca99951c5c9 Mon Sep 17 00:00:00 2001 From: Yann Stepienik Date: Tue, 7 Nov 2023 13:10:40 +0000 Subject: [PATCH] remove fb --- config.json | 3 +++ index.js | 20 ++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 config.json diff --git a/config.json b/config.json new file mode 100644 index 00000000..9cb99bc1 --- /dev/null +++ b/config.json @@ -0,0 +1,3 @@ +{ + "url": "https://azukaar.github.io/cosmos-servapps-official/servapps.json" +} \ No newline at end of file diff --git a/index.js b/index.js index 09a588c7..4868ffdc 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,6 @@ const fs = require('fs') +const { config } = require('process') +const configFile = require('./config.json') // list all directories in the directory servapps and compile them in servapps.json @@ -31,7 +33,17 @@ for (const file of servapps) { servappsJSON.push(servapp) } -fs.writeFileSync('./servapps.json', JSON.stringify(servappsJSON, null, 2)) +// add showcase +const _sc = ["Jellyfin", "Home Assistant", "Nextcloud"]; +const showcases = servappsJSON.filter((app) => _sc.includes(app.name)); + +let apps = { + "source": configFile.url, + "showcase": showcases, + "all": servappsJSON +} + +fs.writeFileSync('./servapps.json', JSON.stringify(apps, null, 2)) for (const servapp of servappsJSON) { servapp.compose = `http://localhost:3000/servapps/${servapp.id}/cosmos-compose.json` @@ -44,8 +56,4 @@ for (const servapp of servappsJSON) { } } -fs.writeFileSync('./servapps_test.json', JSON.stringify({ - source: "", - showcase: [], - all: servappsJSON, -}, null, 2)) +fs.writeFileSync('./servapps_test.json', JSON.stringify(apps, null, 2))