Skip to content

Commit

Permalink
cliffy - use prompt directly to avoid returned value problem
Browse files Browse the repository at this point in the history
  • Loading branch information
cderv committed Jul 29, 2024
1 parent bfc6da4 commit 207aa15
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/command/publish/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 + ")" : ""
Expand All @@ -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 &&
Expand Down

0 comments on commit 207aa15

Please sign in to comment.