From 143e59ca3600030c9653269a8fe2c06123f07521 Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger Date: Sat, 11 May 2024 12:10:40 +0200 Subject: [PATCH] chore(readme): add apps count --- .github/scripts/readme-generator.ts | 7 ++++--- templates/README.md | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/scripts/readme-generator.ts b/.github/scripts/readme-generator.ts index a8b1eade..e84d22fe 100644 --- a/.github/scripts/readme-generator.ts +++ b/.github/scripts/readme-generator.ts @@ -43,12 +43,13 @@ const appToReadme = async (app: App) => { return `| | [${app.name}](${app.source}) | ${app.description} | ${app.port} |`; }; -const writeToReadme = (appsList: string) => { +const writeToReadme = (appsList: string, count: number) => { const baseReadme = fs.readFileSync( __dirname + "/../../templates/README.md", "utf8" ); - const finalReadme = baseReadme.replace("", appsList); + let finalReadme = baseReadme.replace("", appsList); + finalReadme = finalReadme.replace("", count.toString()); fs.writeFileSync(__dirname + "/../../README.md", finalReadme); }; @@ -62,7 +63,7 @@ const main = async () => { appsList = appsList + (appFinal + "\n"); } - writeToReadme(appsList); + writeToReadme(appsList, appKeys.length); exec( `npx prettier ${__dirname + "/../../README.md"} --write`, (stdout, stderr) => { diff --git a/templates/README.md b/templates/README.md index d73b8617..6f276dec 100644 --- a/templates/README.md +++ b/templates/README.md @@ -10,7 +10,7 @@ If you want to see new apps on Tipi you can either: - [Join the Discord](https://discord.gg/Bu9qEPnHsc) members of the community will add it. - Fork this repo and create the necessary files for a Tipi app. Follow this [guide](https://www.runtipi.io/docs/contributing/adding-a-new-app)` -## Apps available +## Apps available () | Icon | Name | Description | Port | | ---- | ---- | ----------- | ---- |