Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
lilkidsuave authored Jun 1, 2024
1 parent ac3d725 commit 8784bf0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
4 changes: 2 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"url": "https://azukaar.github.io/cosmos-servapps-official/servapps.json"
}
"url": "https://lilkidsuave.github.io/cosmos-servapps-unofficial/servapps.json"
}
21 changes: 6 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,18 @@ for (const file of servapps) {
// list all screenshots in the directory servapps/${file}/screenshots
const screenshots = fs.readdirSync(`./servapps/${file}/screenshots`)
for (const screenshot of screenshots) {
servapp.screenshots.push(`https://azukaar.github.io/cosmos-servapps-official/servapps/${file}/screenshots/${screenshot}`)
servapp.screenshots.push(`https://lilkidsuave.github.io/cosmos-servapps-unofficial/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://azukaar.github.io/cosmos-servapps-official/servapps/${file}/artefacts/${artefact}`)
servapp.artefacts[artefact] = (`https://lilkidsuave.github.io/cosmos-servapps-unofficial/servapps/${file}/artefacts/${artefact}`)
}
}

servapp.icon = `https://azukaar.github.io/cosmos-servapps-official/servapps/${file}/icon.png`
//Common Format,used by most
const YMLComposeSource = `https://azukaar.github.io/cosmos-servapps-official/servapps/${file}/docker-compose.yml`;
if(fs.existsSync(`./servapps/${file}/docker-compose.yml`)) {
servapp.compose = YMLComposeSource;
}
//Cosmos Legacy Format
const CosmosComposeSource = `https://azukaar.github.io/cosmos-servapps-official/servapps/${file}/cosmos-compose.json`;
if(fs.existsSync(`./servapps/${file}/cosmos-compose.json`)) {
servapp.compose = CosmosComposeSource;
}
servapp.icon = `https://lilkidsuave.github.io/cosmos-servapps-unofficial/servapps/${file}/icon.png`
servapp.compose = `https://lilkidsuave.github.io/cosmos-servapps-unofficial/servapps/${file}/cosmos-compose.json`

servappsJSON.push(servapp)
}
Expand All @@ -59,10 +50,10 @@ for (const servapp of servappsJSON) {
servapp.compose = `http://localhost:3000/servapps/${servapp.id}/cosmos-compose.json`
servapp.icon = `http://localhost:3000/servapps/${servapp.id}/icon.png`
for (let i = 0; i < servapp.screenshots.length; i++) {
servapp.screenshots[i] = servapp.screenshots[i].replace('https://azukaar.github.io/cosmos-servapps-official', 'http://localhost:3000')
servapp.screenshots[i] = servapp.screenshots[i].replace('https://lilkidsuave.github.io/cosmos-servapps-unofficial', 'http://localhost:3000')
}
for (const artefact in servapp.artefacts) {
servapp.artefacts[artefact] = servapp.artefacts[artefact].replace('https://azukaar.github.io/cosmos-servapps-official', 'http://localhost:3000')
servapp.artefacts[artefact] = servapp.artefacts[artefact].replace('https://lilkidsuave.github.io/cosmos-servapps-unofficial', 'http://localhost:3000')
}
}

Expand Down

0 comments on commit 8784bf0

Please sign in to comment.