Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions packages/cli/src/commands/workspaces/delete/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,20 @@ export default command({
const result = await ctx.api.cloudWorkspace.delete.mutate({ id });
(result.deleted ? deleted : missing).push(id);
}
const summary =
deleted.length === 1
? `Deleted cloud workspace ${deleted[0]}`
: `Deleted ${deleted.length} cloud workspaces`;
if (missing.length > 0) {
const alsoDeleted =
deleted.length > 0 ? ` (deleted: ${deleted.join(", ")})` : "";
throw new CLIError(
`No cloud workspace in this organization: ${missing.join(", ")}${alsoDeleted}`,
"Pass --local or --host <id> if it lives on a machine",
);
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
return {
data: { deleted, missing },
data: { deleted },
message:
missing.length > 0
? `${summary}\nNot found: ${missing.join(", ")}`
: summary,
deleted.length === 1
? `Deleted cloud workspace ${deleted[0]}`
: `Deleted ${deleted.length} cloud workspaces`,
};
}

Expand Down
Loading