diff options
| author | Kasra Bigdeli <[email protected]> | 2019-12-02 22:22:43 -0500 |
|---|---|---|
| committer | Kasra Bigdeli <[email protected]> | 2019-12-02 22:22:43 -0500 |
| commit | d40fb1a79369d84128a27990855e3511cf5da654 (patch) | |
| tree | 30e5ade7f0341294e1bf4cc5a91c6e7945a76d5e | |
| parent | dd939bd4a2dee44cf908c6e0ecd86a8d31335a31 (diff) | |
| download | caprover-one-click-apps-d40fb1a79369d84128a27990855e3511cf5da654.tar.gz caprover-one-click-apps-d40fb1a79369d84128a27990855e3511cf5da654.zip | |
Updated one click app auto generated list
| -rw-r--r-- | npm_run_puplish.js | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/npm_run_puplish.js b/npm_run_puplish.js index 243c3c0..8b237db 100644 --- a/npm_run_puplish.js +++ b/npm_run_puplish.js @@ -16,6 +16,7 @@ .then(function (items) { const apps = items.filter(v => v.includes('.json')); + const appDetails = []; for (var i = 0; i < apps.length; i++) { const contentString = fs.readFileSync(path.join(pathOfApps, apps[i])); @@ -27,12 +28,30 @@ if (captainVersion === "1") { if (contentString.includes("$$cap_root_domain")) throw new Error('V1 should not have root domain') + } else { + } + 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, { - appList: apps + appList: apps, + appDetails: appDetails }); }) |
