From e3d58da310a95a6338fcccb480f58d92e921a3d7 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Wed, 13 Nov 2024 16:02:45 -0500 Subject: [PATCH] feat(upScript): don't show empty sections --- apps/update/src/app.ts | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/apps/update/src/app.ts b/apps/update/src/app.ts index 2c2c3c60..00e15031 100644 --- a/apps/update/src/app.ts +++ b/apps/update/src/app.ts @@ -75,18 +75,27 @@ if (args['a'] || args['all']) { }); const output = [ - 'chore: update flake.lock\n', - `Flake Inputs:\n${flakeOutput}\n`, - `Docker Images:\n${dockerOutput}`, - `Firefox Addons:\n${firefoxOutput}\n`, - `Misc Sources:\n${vuetorrentOutput}\n`, - ].join('\n'); + 'chore: update sources\n\n', + ]; + + if (flakeOutput.length > 5) { + output.push(`Flake Inputs:\n${flakeOutput}\n\n`); + } + if (dockerOutput.length > 5) { + output.push(`Docker Images:\n${dockerOutput}\n`); + } + if (firefoxOutput.length > 5) { + output.push(`Firefox Addons:\n${firefoxOutput}\n\n`); + } + if (vuetorrentOutput.length > 5) { + output.push(`Misc Sources:\n${vuetorrentOutput}\n`); + } if (args['f']) { - writeFileSync(args['f'] as string, output); + writeFileSync(args['f'] as string, output.join('')); } else { - console.log(output); + console.log(output.join('')); } }