Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
lilkidsuave authored Feb 13, 2024
1 parent 6000a78 commit 7b3bcd2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,21 @@ for (const file of servapps) {
servapp.id = file;
servapp.screenshots = [];
servapp.artefacts = {};
servapp.icon = `https://lilkidsuave.github.io/asteroidsinthecosmos/servapps/${file}/icon.png`
servapp.compose = `https://lilkidsuave.github.io/asteroidsinthecosmos/servapps/${file}/docker-compose.yml`
// list all screenshots in the directory servapps/${file}/screenshots
if (fs.existsSync(`./servapps/${file}/screenshots`)) {
const screenshots = fs.readdirSync(`./servapps/${file}/screenshots`);
for (const screenshot of screenshots) {
servapp.screenshots.push(`https://lilkidsuave.github.io/asteroidsinthecosmos/servapps/${file}/screenshots/${screenshot}`);
}
}

if (fs.existsSync(`./servapps/${file}/artefacts`)) {
const artefacts = fs.readdirSync(`./servapps/${file}/artefacts`);
for (const artefact of artefacts) {
servapp.artefacts[artefact] = (`https://lilkidsuave.github.io/asteroidsinthecosmos/servapps/${file}/artefacts/${artefact}`);
}
}
servapp.icon = `https://lilkidsuave.github.io/asteroidsinthecosmos/servapps/${file}/icon.png`
servapp.compose = `https://lilkidsuave.github.io/asteroidsinthecosmos/servapps/${file}/docker-compose.yml`
servappsJSON.push(servapp)
} catch (error) {
if (error.message.includes('is not defined')) {
Expand Down

0 comments on commit 7b3bcd2

Please sign in to comment.