Skip to content

Commit

Permalink
Merge pull request #10411 from quarto-dev/fix/cliffy-prompt
Browse files Browse the repository at this point in the history
cliffy - `Checkbox.prompt` returns value directly as a string
  • Loading branch information
cscheid authored Aug 1, 2024
2 parents 843a420 + 207aa15 commit fe989e5
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 fe989e5

Please sign in to comment.