MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / execute

Method execute

atomic-cli/src/commands/team/delete.rs:87–121  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

85
86impl TeamDelete {
87 async fn execute(&self) -> CliResult<()> {
88 // Prompt for confirmation unless --force is set.
89 if !self.force {
90 print_warning(&format!(
91 "This will permanently delete team '{}' and all its memberships and grants.",
92 self.slug
93 ));
94
95 let confirmed = dialoguer::Confirm::new()
96 .with_prompt("Are you sure?")
97 .default(false)
98 .interact()
99 .map_err(|e| {
100 CliError::Internal(anyhow::anyhow!("Failed to read confirmation: {e}"))
101 })?;
102
103 if !confirmed {
104 return Err(CliError::Cancelled);
105 }
106 }
107
108 let client = build_client(self.org.as_deref(), None).await?;
109 let org_slug = client.org_slug().to_string();
110
111 atomic_teams::team::delete_team(&client, &org_slug, &self.slug)
112 .await
113 .map_err(|e| CliError::RemoteError {
114 message: e.to_string(),
115 url: None,
116 })?;
117
118 print_success(&format!("Deleted team: {}", self.slug));
119
120 Ok(())
121 }
122}
123
124#[cfg(test)]

Callers 1

runMethod · 0.45

Calls 7

print_warningFunction · 0.85
build_clientFunction · 0.85
delete_teamFunction · 0.85
print_successFunction · 0.85
with_promptMethod · 0.80
org_slugMethod · 0.80
defaultMethod · 0.45

Tested by

no test coverage detected