From 7b34fd4b99fc4b7da1d0d9cc67abf3ec83fa3726 Mon Sep 17 00:00:00 2001 From: Glen Maddern Date: Sat, 16 Jan 2021 13:51:54 +0000 Subject: [PATCH] You can combine these blocks if you prefer Doesn't really matter, only difference is each `shellac` call creates a new shell instance, so if you start using environment vars or something it changes how long they live for. --- src/index.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/index.ts b/src/index.ts index 9ac0804..8771776 100644 --- a/src/index.ts +++ b/src/index.ts @@ -92,20 +92,18 @@ class Releasecast extends Command { await shellac.in(tmpDir.path)` $$ mv "${name} ${version}.dmg" ${name}-${version}.dmg $$ rm -rf ${app} - ` - this.log(`✔ Renamed to ${name}-${version}.dmg`) - const {dmg_count} = await shellac.in(tmpDir.path)` + await ${() => this.log(`✔ Renamed to ${name}-${version}.dmg`)} + $ ls *.dmg | wc -l - stdout >> dmg_count + stdout >> ${(dmg_count) => { + if (Number(dmg_count) > 5) { + this.warn('Only the latest five releases will be processed by appcast') + } + this.log() + }} ` - if (Number(dmg_count) > 5) { - this.warn('Only the latest five releases will be processed by appcast') - } - - this.log() - this.log(chalk.yellow('⚡️ 2. Notarising DMG with Apple')) if (dry) { this.log(chalk.cyan('🤚 Skipping notarisation'))