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

Function resolve_org

atomic-cli/src/commands/client.rs:179–200  ·  view source on GitHub ↗

Resolve the org slug using the legacy (single-server) config path. Kept for callers that don't yet pass a server override.

(org_override: Option<&str>)

Source from the content-addressed store, hash-verified

177///
178/// Kept for callers that don't yet pass a server override.
179pub fn resolve_org(org_override: Option<&str>) -> CliResult<String> {
180 if let Some(s) = org_override {
181 if s.is_empty() {
182 return Err(CliError::InvalidArgument {
183 message: "Organization slug cannot be empty.".to_string(),
184 });
185 }
186 return Ok(s.to_string());
187 }
188
189 let config = GlobalConfig::load()
190 .map_err(|e| CliError::Internal(anyhow::anyhow!("Failed to load global config: {}", e)))?;
191
192 config
193 .server
194 .default_org
195 .ok_or_else(|| CliError::InvalidArgument {
196 message: "No organization specified.\n \
197 Use --org or set a default with: atomic org set <slug>"
198 .to_string(),
199 })
200}
201
202/// Resolve the workspace slug for a command, with fallback to the
203/// org-scoped default workspace from a server config.

Calls 1

is_emptyMethod · 0.45