From 1275caeb28c8b3ca956f18bd26e870298797caf3 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Wed, 25 Oct 2023 10:33:52 -0700 Subject: [PATCH] chore: skip confirmation during smoke publish --- scripts/publish.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/scripts/publish.js b/scripts/publish.js index f9b4b0bec8c46..c74fc57680e31 100644 --- a/scripts/publish.js +++ b/scripts/publish.js @@ -87,10 +87,19 @@ const main = async (opts) => { table.push([publish.name, publish.version, publish.tag]) } - const prompt = `Ready to publish the following packages:\n${table.toString()}\nOk to proceed? ` - const confirm = await read({ prompt, default: 'y' }) - if (confirm.trim().toLowerCase().charAt(0) !== 'y') { - throw new Error('Aborted') + const confirmMessage = [ + `Ready to ${packOnly ? 'pack' : 'publish'} the following packages:`, + table.toString(), + packOnly ? null : 'Ok to proceed? ', + ].filter(Boolean).join('\n') + + if (packOnly) { + log.info(confirmMessage) + } else { + const confirm = await read({ prompt: confirmMessage, default: 'y' }) + if (confirm.trim().toLowerCase().charAt(0) !== 'y') { + throw new Error('Aborted') + } } await git('clean', '-fd')