Skip to content

Commit

Permalink
chore: skip confirmation during smoke publish
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Oct 26, 2023
1 parent e6cce28 commit 1275cae
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions scripts/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 1275cae

Please sign in to comment.