Updated one click app auto generated list
This commit is contained in:
parent
dd939bd4a2
commit
d40fb1a793
|
|
@ -16,6 +16,7 @@
|
||||||
.then(function (items) {
|
.then(function (items) {
|
||||||
|
|
||||||
const apps = items.filter(v => v.includes('.json'));
|
const apps = items.filter(v => v.includes('.json'));
|
||||||
|
const appDetails = [];
|
||||||
|
|
||||||
for (var i = 0; i < apps.length; i++) {
|
for (var i = 0; i < apps.length; i++) {
|
||||||
const contentString = fs.readFileSync(path.join(pathOfApps, apps[i]));
|
const contentString = fs.readFileSync(path.join(pathOfApps, apps[i]));
|
||||||
|
|
@ -27,12 +28,30 @@
|
||||||
if (captainVersion === "1") {
|
if (captainVersion === "1") {
|
||||||
if (contentString.includes("$$cap_root_domain"))
|
if (contentString.includes("$$cap_root_domain"))
|
||||||
throw new Error('V1 should not have root domain')
|
throw new Error('V1 should not have root domain')
|
||||||
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
apps[i] = apps[i].replace('.json', '');
|
apps[i] = apps[i].replace('.json', '');
|
||||||
|
|
||||||
|
if (captainVersion + '' === '2') {
|
||||||
|
if (!content.displayName) content.displayName = apps[i]
|
||||||
|
if (!content.description) content.description = ''
|
||||||
|
if (!content.imageUrl) content.imageUrl = 'https://caprover.com/img/logo.png'
|
||||||
|
|
||||||
|
appDetails[i] = {
|
||||||
|
name: apps[i],
|
||||||
|
displayName: content.displayName,
|
||||||
|
description: content.description,
|
||||||
|
imageUrl: content.imageUrl,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fs.outputJsonSync(pathOfList, {
|
fs.outputJsonSync(pathOfList, {
|
||||||
appList: apps
|
appList: apps,
|
||||||
|
appDetails: appDetails
|
||||||
});
|
});
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue