From 207aa156b61efa1df8a6b13847a400c0a02ede88 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Mon, 29 Jul 2024 15:55:08 +0200 Subject: [PATCH] cliffy - use prompt directly to avoid returned value problem --- src/command/publish/account.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/command/publish/account.ts b/src/command/publish/account.ts index 4a874245ef..d420b2346b 100644 --- a/src/command/publish/account.ts +++ b/src/command/publish/account.ts @@ -151,8 +151,11 @@ export async function manageAccounts() { } // create a checked list from which accounts can be removed - const keepAccounts = await Checkbox.prompt({ + const keepAccounts = await prompt([{ + name: "accounts", message: "Manage Publishing Accounts", + type: Checkbox, + indent: "", options: accounts.map((account) => ({ name: `${findProvider(account.provider)?.description}: ${account.name}${ account.server ? " (" + account.server + ")" : "" @@ -163,15 +166,15 @@ export async function manageAccounts() { hint: `Use the arrow keys and spacebar to specify accounts you would like to remove.\n` + ` Press Enter to confirm the list of accounts you wish to remain available.`, - }); + }]); // figure out which accounts we should be removing const removeAccounts: ProviderAccountToken[] = []; for (const account of accounts) { if ( - !keepAccounts.find((keepAccountJson) => { + !keepAccounts.accounts?.find((keepAccountJson: string) => { const keepAccount = JSON.parse( - keepAccountJson.value, + keepAccountJson, ) as ProviderAccountToken; return account.provider == keepAccount.provider && account.name == keepAccount.name &&