From d608ecd7c3af36fd809c0590119c5782f52d3ba3 Mon Sep 17 00:00:00 2001 From: Alison Winters Date: Mon, 7 Nov 2022 19:43:41 +0800 Subject: [PATCH] feat: prompt for full name to confirm unpublish action (#782) (#783) --- src/publish.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/publish.ts b/src/publish.ts index f1fc1bbf..27123db4 100644 --- a/src/publish.ts +++ b/src/publish.ts @@ -242,9 +242,9 @@ export async function unpublish(options: IUnpublishOptions = {}): Promise { const fullName = `${publisher}.${name}`; if (!options.force) { - const answer = await read(`This will FOREVER delete '${fullName}'! Are you sure? [y/N] `); + const answer = await read(`This will delete ALL published versions! Please type '${fullName}' to confirm: `); - if (!/^y$/i.test(answer)) { + if (answer !== fullName) { throw new Error('Aborted'); } }