Skip to content

Commit c7ab675

Browse files
committed
chore: skip confirmation during smoke publish
1 parent b776753 commit c7ab675

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

scripts/publish.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,19 @@ const main = async (opts) => {
8787
table.push([publish.name, publish.version, publish.tag])
8888
}
8989

90-
const prompt = `Ready to publish the following packages:\n${table.toString()}\nOk to proceed? `
91-
const confirm = await read({ prompt, default: 'y' })
92-
if (confirm.trim().toLowerCase().charAt(0) !== 'y') {
93-
throw new Error('Aborted')
90+
const confirmMessage = [
91+
`Ready to ${packOnly ? 'pack' : 'publish'} the following packages:`,
92+
table.toString(),
93+
packOnly ? null : 'Ok to proceed? ',
94+
].filter(Boolean).join('\n')
95+
96+
if (packOnly) {
97+
log.info(confirmMessage)
98+
} else {
99+
const confirm = await read({ prompt: confirmMessage, default: 'y' })
100+
if (confirm.trim().toLowerCase().charAt(0) !== 'y') {
101+
throw new Error('Aborted')
102+
}
94103
}
95104

96105
await git('clean', '-fd')

0 commit comments

Comments
 (0)